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
|
return True
|
||||||
for email in self.managers:
|
for email in self.managers:
|
||||||
manager = User.objects.get(email=email)
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class BulletinItem(models.Model):
|
|||||||
return True
|
return True
|
||||||
if user == self.author:
|
if user == self.author:
|
||||||
return True
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user