From e629b7a3d9052b8f701b5b540ea5b0dacf12d056 Mon Sep 17 00:00:00 2001 From: jmrq9 Date: Tue, 10 Dec 2024 23:47:17 +0100 Subject: [PATCH] fix for users in external_contractors group --- zapisy/apps/users/templates/users/my_profile.html | 4 +++- zapisy/apps/users/views.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zapisy/apps/users/templates/users/my_profile.html b/zapisy/apps/users/templates/users/my_profile.html index 2c166825ad..0820341c38 100644 --- a/zapisy/apps/users/templates/users/my_profile.html +++ b/zapisy/apps/users/templates/users/my_profile.html @@ -63,8 +63,10 @@

Moje dane

Zmień hasło - {% if user.employee %} + {% if user.employee or is_external_contractor %} Zmień adres email + {% endif %} + {% if user.employee %} Zmień inne dane {% endif %} diff --git a/zapisy/apps/users/views.py b/zapisy/apps/users/views.py index a7f5753148..70253f60db 100644 --- a/zapisy/apps/users/views.py +++ b/zapisy/apps/users/views.py @@ -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() @@ -159,9 +159,11 @@ def my_profile(request): consultations). """ semester = Semester.get_upcoming_semester() + is_ext_contractor = is_external_contractor(request.user) data = { 'semester': semester, + 'is_external_contractor': is_ext_contractor, } if request.user.employee: