From 0d5fbf4eb3c15b7f7eb2d3c9cda7478f746e96a1 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Thu, 24 Jul 2014 14:06:21 +0000 Subject: [PATCH] Fixed a problem with trying to use None as a Q object. - Legacy-Id: 8202 --- ietf/ietfauth/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/ietfauth/utils.py b/ietf/ietfauth/utils.py index 4b00f64b0..b755c871a 100644 --- a/ietf/ietfauth/utils.py +++ b/ietf/ietfauth/utils.py @@ -107,8 +107,6 @@ def is_authorized_in_doc_stream(user, doc): # must be authorized in the stream or group - group_req = None - if (not doc.stream or doc.stream.slug == "ietf") and has_role(user, ["Area Director"]): return True @@ -124,6 +122,8 @@ def is_authorized_in_doc_stream(user, doc): group_req = Q(group__acronym=doc.stream.slug) | Q(group=doc.group) elif doc.stream.slug in ("iab", "ise"): group_req = Q(group__acronym=doc.stream.slug) + else: + group_req = Q() - return bool(Role.objects.filter(Q(name__in=("chair", "secr", "delegate", "auth"), person__user=user) & group_req)) + return Role.objects.filter(Q(name__in=("chair", "secr", "delegate", "auth"), person__user=user) & group_req)