On remplace les Querysets par ce qu'on veut

This commit is contained in:
Tom Hubrecht 2021-10-26 19:06:23 +02:00
parent 3da477729a
commit d5c1e2225a
2 changed files with 7 additions and 4 deletions

View file

@ -6,9 +6,9 @@
<h2>Liste des groupes administrés</h2> <h2>Liste des groupes administrés</h2>
<hr> <hr>
{% if wikigroups %} {% if wikigroup_list %}
<div class="list-group"> <div class="list-group">
{% for group in wikigroups %} {% for group in wikigroup_list %}
<a class="list-group-item list-group-item-action" href="{% url 'wiki_groups:admin-group' group.pk %}">{{ group }}</a> <a class="list-group-item list-group-item-action" href="{% url 'wiki_groups:admin-group' group.pk %}">{{ group }}</a>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -67,10 +67,13 @@ class ManagedGroupsView(LoginRequiredMixin, ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs) ctx = super().get_context_data(**kwargs)
ctx["wikigroups"] = set() wikigroups = set()
for group in ctx["wikigroup_list"]: for group in ctx["wikigroup_list"]:
ctx["wikigroups"] |= group.get_all_groups() wikigroups |= group.get_all_groups()
ctx["wikigroup_list"] = wikigroups
ctx["object_list"] = wikigroups
return ctx return ctx