Skip to content

Commit

Permalink
fix for users in external_contractors group
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrq9 committed Dec 10, 2024
1 parent 0c21e2d commit e629b7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion zapisy/apps/users/templates/users/my_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ <h2>Moje dane</h2>
</table>

<a class="btn btn-light" href="{% url 'password_change' %}" role="button">Zmień hasło</a>
{% if user.employee %}
{% if user.employee or is_external_contractor %}
<a class="btn btn-light" href="{% url 'email-change' %}" role="button">Zmień adres email</a>
{% endif %}
{% if user.employee %}
<a class="btn btn-light" href="{% url 'employee-data-change' %}" role="button">Zmień inne dane</a>
{% endif %}
</div>
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)

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

if request.user.employee:
Expand Down

0 comments on commit e629b7a

Please sign in to comment.