8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-09-17 11:43:08 +00:00

Remplacement date inscription par date fin cotis dans liste

Petit tiret
This commit is contained in:
Dalahro 2016-07-05 20:01:37 +02:00
parent 4f2236c9e0
commit b7b76ba05a
4 changed files with 15 additions and 5 deletions

View file

@ -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))

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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):