Commit 83a5de4d authored by Michal Čihař's avatar Michal Čihař

List owners on ACL management page

Issue #720
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent a242bb11
......@@ -164,6 +164,23 @@
</tr>
</thead>
<tbody>
{% for user in object.owners.all %}
<tr>
<td>{{ user.username }} <span class="badge">{% trans "Owner" %}</span></td>
<td>{{ user.first_name }}</td>
<td>{{ user.email }}</td>
<td>
<form action="{% url "delete-user" project=object.slug %}" method="post">
{% csrf_token %}
<input type="hidden" name="name" value="{{ user.username }}" />
<button type="submit" class="btn btn-danger btn-xs">
<i class="fa fa-trash"></i>
{% trans "Remove" %}
</button>
</form>
</td>
</tr>
{% endfor %}
{% for user in object.all_users %}
<tr>
<td>{{ user.username }}</td>
......
......@@ -192,7 +192,9 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
Returns all users having ACL on this project.
"""
group = Group.objects.get(name=self.name)
return group.user_set.all()
return group.user_set.exclude(
id__in=self.owners.values_list('id', flat=True)
)
def add_user(self, user):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment