8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-22 23:13:46 +00:00

Merge branch 'fix_login_and_ap' into 'dev'

Fix login next + display ap

See merge request federez/re2o!335
This commit is contained in:
chirac 2018-10-14 22:12:47 +02:00
commit 184732a18d
4 changed files with 8 additions and 2 deletions

View file

@ -29,7 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}{% trans "Log in" %}{% endblock %}
{% block content %}
<form method="post" action="{% url 'login' %}">
<form method="post" action="">
{% csrf_token %}
{% bootstrap_form form %}
<button class="btn btn-success" type="submit">

View file

@ -468,6 +468,10 @@ class Building(AclMixin, RevMixin, models.Model):
verbose_name = _("building")
verbose_name_plural = _("buildings")
def all_ap_in(self):
"""Returns all ap of the building"""
return AccessPoint.all_ap_in(self)
def __str__(self):
return self.name

View file

@ -35,12 +35,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
{% trans "Building" as tr_building %}
<th>{% include "buttons/sort.html" with prefix='building' col='name' text=tr_building %}</th>
<th>Wireless AP</th>
<th></th>
</tr>
</thead>
{% for building in building_list %}
<tr>
<td>{{ building.name }}</td>
<td>{% for ap in building.all_ap_in %} {{ ap.short_name }} {% endfor %}</td>
<td class="text-right">
{% can_edit building %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-building' building.id %}">

View file

@ -230,7 +230,7 @@ def index_ap(request):
queryset=(Interface.objects
.select_related('ipv4__ip_type__extension')
.select_related('domain__extension'))
)))
)).distinct())
ap_list = SortTable.sort(
ap_list,
request.GET.get('col'),