From 95893c04d99e293296152035d4df8ba796c4cfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Mon, 11 Aug 2014 23:53:32 -0700 Subject: [PATCH] permission.granted_to now handle anonymous user --- issue/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/issue/models.py b/issue/models.py index 6abd48f..98a8138 100644 --- a/issue/models.py +++ b/issue/models.py @@ -392,6 +392,8 @@ class PermissionModel(models.Model): abstract = True def granted_to(self, user): + if not user.is_authenticated(): + return False if self.grantee_type == self.GRANTEE_USER: return user.username == self.grantee_name elif self.grantee_type == self.GRANTEE_GROUP: