mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
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>
This commit is contained in:
parent
cd3a5a7b2a
commit
979fb7980d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user