From 8c9404e15eb605aa1214aa179c58d13f4be386ed Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 7 Mar 2012 09:59:59 +0000 Subject: [PATCH] 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 --- ietf/liaisons/accountsREDESIGN.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/liaisons/accountsREDESIGN.py b/ietf/liaisons/accountsREDESIGN.py index b97496a4d..f4fde54df 100644 --- a/ietf/liaisons/accountsREDESIGN.py +++ b/ietf/liaisons/accountsREDESIGN.py @@ -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"))