aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-28 21:39:00 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-03-28 21:39:00 +0000
commit979fb7980dbd00ac4063bb0b8516832d1bc530ac (patch)
treef3d104a4acef0fee26144c30be27b732f8759027 /layerindex
parentcd3a5a7b2a52a1e7b82d3f714f39c57a1e7449d4 (diff)
downloadopenembedded-core-contrib-979fb7980dbd00ac4063bb0b8516832d1bc530ac.tar.gz
Fix "AnonymousUser has no attribute 'email'" errors when not logged in
We shouldn't be looking for this attribute unless the user has logged in - this was a regression in the recent email case fix. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex')
-rw-r--r--layerindex/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/layerindex/models.py b/layerindex/models.py
index 5f73acf3ba..ec63f780ed 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -76,8 +76,8 @@ class LayerItem(models.Model):
return matches
def user_can_edit(self, user):
- user_email = user.email.strip().lower()
if user.is_authenticated():
+ user_email = user.email.strip().lower()
for maintainer in self.active_maintainers():
if maintainer.email.strip().lower() == user_email:
return True