Guard against trying to use .is_authenticated() on a plain string. The error condition can occur when an exception has been triggered before the auth middleware has run. Related to #767 and #768.
- Legacy-Id: 4053
This commit is contained in:
parent
e6c42e76e9
commit
8c9404e15e
|
@ -86,6 +86,8 @@ def is_sdo_authorized_individual(person):
|
|||
|
||||
|
||||
def is_secretariat(user):
|
||||
if isinstance(user, basestring):
|
||||
return False
|
||||
return user.is_authenticated() and bool(Role.objects.filter(person__user=user, name="secr", group__acronym="secretariat"))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue