Improve notif and organization add member
This commit is contained in:
parent
cdbed121cd
commit
7406d081aa
10 changed files with 297 additions and 149 deletions
|
@ -158,7 +158,11 @@ class Organization(models.Model):
|
|||
return reverse("organization_submissions", args=(self.id, self.slug))
|
||||
|
||||
def is_admin(self, profile):
|
||||
return self.admins.filter(id=profile.id).exists()
|
||||
return profile.id in self.get_admin_ids()
|
||||
|
||||
@cache_wrapper(prefix="Orgai", expected_type=list)
|
||||
def get_admin_ids(self):
|
||||
return list(self.admins.values_list("id", flat=True))
|
||||
|
||||
def is_member(self, profile):
|
||||
return profile in self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue