Fix error on attempting to view
This commit is contained in:
parent
9ce8af1200
commit
64ed052acf
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user