Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honoring privacy settings in theses #1611

Open
wants to merge 4 commits into
base: master-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions zapisy/apps/theses/templates/theses/thesis.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,7 @@ <h1 class="d-inline-block">
</tr>
<tr>
<th scope="row">Studenci</th>
<td>
{% for student in students %}
{{ student }}&nbsp;
{% empty %}
Brak
{% endfor %}
</td>
<td>{{ students_str|default:"Brak" }}</td>
</tr>
<tr>
<th scope="row">Zarezerwowana do</th>
Expand Down
12 changes: 11 additions & 1 deletion zapisy/apps/theses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ def list_all(request):
request.user) or p.is_supporting_advisor_assigned(request.user)
advisor = str(p.advisor) + (f" ({p.supporting_advisor})" if p.supporting_advisor else "")
advisor_last_name = p.advisor.user.last_name if p.advisor else p.advisor.__str__()
students = ", ".join(s.get_full_name() for s in p.students.all())
students = ", ".join(
s.get_full_name() if (request.user.employee or s.consent_granted())
else s.matricula
for s in p.students.all()
)
url = reverse('theses:selected_thesis', None, [str(p.id)])

record = {
Expand Down Expand Up @@ -78,6 +82,11 @@ def view_thesis(request, id):
request.user) or user_privileged_for_thesis

students = thesis.students.all()
students_str = ", ".join(
str(s) if (request.user.employee or s.consent_granted())
else s.matricula
for s in students
)

all_voters = get_theses_board()
votes = []
Expand Down Expand Up @@ -128,6 +137,7 @@ def view_thesis(request, id):
request, 'theses/thesis.html', {
'thesis': thesis,
'students': students,
'students_str': students_str,
'board_member': board_member,
'show_master_rejecter': show_master_rejecter,
'can_see_remarks': user_privileged_for_thesis,
Expand Down
Loading