Skip to content

Commit

Permalink
Fix crash for users without an org employer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarton committed Oct 16, 2024
1 parent f82aad3 commit 7e2b4b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion epilepsy12/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def wrapper(request, *args, **kwargs):
user = request.user

requested_id = kwargs.get("id")
parent = getattr(user.organisation_employer, parent_type)
parent = getattr(user.organisation_employer, parent_type) if user.organisation_employer else None

can_view_parent = parent and parent.id == requested_id
is_lead_clinican = user.role == AUDIT_CENTRE_LEAD_CLINICIAN
Expand Down

0 comments on commit 7e2b4b8

Please sign in to comment.