mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-31 10:29:15 +01:00
Verify ticket.assigned_to is set before attempting to access id property
This commit is contained in:
parent
0774692742
commit
b772c6097b
@ -79,7 +79,7 @@ def _has_access_to_queue(user, queue):
|
|||||||
def _is_my_ticket(user, ticket):
|
def _is_my_ticket(user, ticket):
|
||||||
"""Check to see if the user has permission to access
|
"""Check to see if the user has permission to access
|
||||||
a ticket. If not then deny access."""
|
a ticket. If not then deny access."""
|
||||||
if user.is_superuser or user.is_staff or user.id == ticket.assigned_to.id:
|
if user.is_superuser or user.is_staff or (ticket.assigned_to and user.id == ticket.assigned_to.id):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user