Fix error on attempting to view

This commit is contained in:
Yingtong Li 2019-02-09 23:13:03 +11:00
parent 9ce8af1200
commit 64ed052acf
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
1 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class Group(models.Model):
return True
for email in self.managers:
manager = User.objects.get(email=email)
if user.email in manager.delegates:
if hasattr(manager, 'userprofile') and user.email in manager.userprofile.delegates:
return True
return False
@ -96,7 +96,7 @@ class BulletinItem(models.Model):
return True
if user == self.author:
return True
if user.email in self.author.delegates:
if hasattr(self.author, 'userprofile') and user.email in self.author.userprofile.delegates:
return True
return False