Make admin members

This commit is contained in:
cuom1999 2022-05-28 02:29:25 -05:00
parent b1a52cc872
commit b8876ba023
3 changed files with 7 additions and 6 deletions

View file

@ -112,6 +112,10 @@ class Organization(models.Model):
def get_contests_url(self):
return reverse("organization_contests", args=(self.id, self.slug))
def save(self, *args, **kwargs):
self.members.add(*self.admins.all())
super(Organization, self).save(*args, **kwargs)
class Meta:
ordering = ["name"]
permissions = (

View file

@ -151,11 +151,8 @@ class OrganizationList(TitleMixin, ListView, OrganizationBase):
def get_context_data(self, **kwargs):
context = super(OrganizationList, self).get_context_data(**kwargs)
context["my_organizations"] = set()
for organization in context["organizations"]:
if self.can_edit_organization(organization) or self.is_member(organization):
context["my_organizations"].add(organization)
if self.request.profile:
context["my_organizations"] = self.request.profile.organizations.all()
return context

View file

@ -7,7 +7,7 @@
{% for user in top_rated %}
<tr>
<td style="padding: 7px 2px"><b>{{loop.index}}</b></td>
<td>{{link_user(user)}}</td>
<td style="line-break: anywhere">{{link_user(user)}}</td>
<td>{{user.rating}}</td>
</tr>
{% endfor %}