From 00111065ea26cf121cc160c8263b1c010ec52000 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 7 Mar 2012 10:00:31 +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: 4054 --- ietf/ietfworkflows/accounts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/ietfworkflows/accounts.py b/ietf/ietfworkflows/accounts.py index 81d53ac5f..4b7046462 100644 --- a/ietf/ietfworkflows/accounts.py +++ b/ietf/ietfworkflows/accounts.py @@ -53,6 +53,8 @@ def is_chair_of_stream(user, stream): def is_chair_of_streamREDESIGN(user, stream): if is_secretariat(user): return True + if isinstance(user, basestring): + return False return user.is_authenticated() and bool(Role.objects.filter(group__acronym=stream.slug, name="chair", person__user=user))