Remember to check for is_authenticated() before accessing
get_profile() on user - Legacy-Id: 3363
This commit is contained in:
parent
1cc908f137
commit
60a822abde
|
@ -31,6 +31,9 @@ def get_iab_executive_director():
|
|||
|
||||
|
||||
def get_person_for_user(user):
|
||||
if not user.is_authenticated():
|
||||
return None
|
||||
|
||||
p = user.get_profile()
|
||||
p.email = lambda: (p.name, p.email_address().address)
|
||||
|
||||
|
@ -83,7 +86,7 @@ def is_sdo_authorized_individual(person):
|
|||
|
||||
|
||||
def is_secretariat(user):
|
||||
return bool(Role.objects.filter(email__person=user.get_profile(), name="secr", group__acronym="secretariat"))
|
||||
return user.is_authenticated() and bool(Role.objects.filter(email__person=user.get_profile(), name="secr", group__acronym="secretariat"))
|
||||
|
||||
|
||||
def can_add_incoming_liaison(user):
|
||||
|
|
Loading…
Reference in a new issue