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 2 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
2 changes: 1 addition & 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,7 @@ <h2>Moje dane</h2>
</table>

<a class="btn btn-light" href="{% url 'password_change' %}" role="button">Zmień hasło</a>
{% if not user.student %}
{% if user.employee or is_external_contractor %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Zostawiłbym też or not user.student żeby pozostawić dotychczasowe zachowanie dla hipotetycznych użytkowników nie będących w żadnej z tych trzech grup (bez tracenia czasu na dalsze zastanawianie się, czy oni w ogóle istnieją).

<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