Commit b7b76ba0 authored by Dalahro's avatar Dalahro

Remplacement date inscription par date fin cotis dans liste

Petit tiret
parent 4f2236c9
......@@ -12,6 +12,7 @@ from machines.models import Machine, Interface
from cotisations.models import Facture
from search.models import SearchForm, SearchFormPlus
from users.views import has_access
from cotisations.views import end_adhesion
def form(ctx, template, request):
c = ctx
......@@ -54,9 +55,13 @@ def search_result(search, type):
users = User.objects.filter((Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) & query)
connexion = []
for user in users:
end=end_adhesion(user)
access=has_access(user)
if(len(co)==0 or (len(co)==1 and bool(co[0])==access) or (len(co)==2 and (bool(co[0])==access or bool(co[1])==access))):
connexion.append([user, access])
if(end!=None):
connexion.append([user, access, end])
else:
connexion.append([user, access, "Non adhérent"])
query = Q(user__pseudo__icontains = search) | Q(user__name__icontains = search) | Q(user__surname__icontains = search)
if i == '1':
machines = Interface.objects.filter(machine=Machine.objects.filter(query)) | Interface.objects.filter(Q(dns__icontains = search))
......
......@@ -4,7 +4,7 @@
<th>Prénom</th>
<th>Nom</th>
<th>Pseudo</th>
<th>Inscrit le</th>
<th>Fin de cotisation le</th>
<th>Connexion</th>
<th>Profil</th>
</tr>
......@@ -14,7 +14,7 @@
<td>{{ donnee.0.name }}</td>
<td>{{ donnee.0.surname }}</td>
<td>{{ donnee.0.pseudo }}</td>
<td>{{ donnee.0.registered }}</td>
<td>{{ donnee.2 }}</td>
<td>{% if donnee.1 == True %}
<font color="green">Active</font>
{% else %}
......
......@@ -74,7 +74,7 @@
{% endif %}
<th>Droits</th>
{% if list_droits %}
<td>{% for droit in list_droits %}{{ droit.right }} - {% endfor %}</td>
<td>{% for droit in list_droits %}{{ droit.right }}{% if list_droits|length != forloop.counter %} - {% endif %} {% endfor %}</td>
{% else %}
<td>Aucun</td>
{% endif %}
......
......@@ -221,7 +221,12 @@ def index(request):
users_list = User.objects.order_by('pk')
connexion = []
for user in users_list:
connexion.append([user, has_access(user)])
end = end_adhesion(user)
access = has_access(user)
if(end!=None):
connexion.append([user, access, end])
else:
connexion.append([user, access, "Non adhérent"])
return render(request, 'users/index.html', {'users_list': connexion})
def index_ban(request):
......
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