Skip to content

Commit

Permalink
Merge pull request #1087 from rcpch/mbarton/org-audit-rcpch-staff-mis…
Browse files Browse the repository at this point in the history
…sing-org-employer

Fix crash for users without an org employer
  • Loading branch information
mbarton authored Oct 16, 2024
2 parents f82aad3 + 7e2b4b8 commit 24017f6
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 24017f6

Please sign in to comment.