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

phd student now has email change button #1767

Open
wants to merge 3 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
7 changes: 6 additions & 1 deletion zapisy/apps/users/templates/users/my_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ <h2>Moje dane</h2>
</table>

<a class="btn btn-light" href="{% url 'password_change' %}" role="button">Zmień hasło</a>
{% if not user.student %}
<!--
A phd student is defined as a user who is both a student and an employee.
The "external_contractors" group represents people who are not regular employees or students.
Note: There are other user groups in the system that are not yet considered in the condition below.
-->
{% if user.employee or is_external_contractor or not user.student %}
<a class="btn btn-light" href="{% url 'email-change' %}" role="button">Zmień adres email</a>
{% endif %}
{% if user.employee %}
Expand Down
4 changes: 3 additions & 1 deletion zapisy/apps/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from apps.users.decorators import employee_required, external_contractor_forbidden

from .forms import EmailChangeForm, EmployeeDataForm
from .models import Employee, PersonalDataConsent, Student
from .models import Employee, PersonalDataConsent, Student, is_external_contractor

logger = logging.getLogger()

Expand Down Expand Up @@ -159,9 +159,11 @@ def my_profile(request):
consultations).
"""
semester = Semester.get_upcoming_semester()
is_ext_contractor = is_external_contractor(request.user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
is_ext_contractor = is_external_contractor(request.user)
is_external_contractor = is_external_contractor(request.user)

Jeszcze nie jest tak źle z długością naszych identyfikatorów / wierszy kodu.


data = {
'semester': semester,
'is_external_contractor': is_ext_contractor,
}

if request.user.employee:
Expand Down
Loading