Make admin members
This commit is contained in:
parent
b1a52cc872
commit
b8876ba023
3 changed files with 7 additions and 6 deletions
|
@ -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 = (
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue