diff --git a/cotisations/__pycache__/views.cpython-34.pyc b/cotisations/__pycache__/views.cpython-34.pyc index 4fbbb82e..03ffb108 100644 Binary files a/cotisations/__pycache__/views.cpython-34.pyc and b/cotisations/__pycache__/views.cpython-34.pyc differ diff --git a/search/__pycache__/views.cpython-34.pyc b/search/__pycache__/views.cpython-34.pyc index 9d6cc725..da15f326 100644 Binary files a/search/__pycache__/views.cpython-34.pyc and b/search/__pycache__/views.cpython-34.pyc differ diff --git a/search/views.py b/search/views.py index d27c4614..4e2211dc 100644 --- a/search/views.py +++ b/search/views.py @@ -11,6 +11,7 @@ from users.models import User, Ban from machines.models import Machine from cotisations.models import Facture from search.models import SearchForm +from users.views import has_access def form(ctx, template, request): c = ctx @@ -23,11 +24,14 @@ def search(request): if search.is_valid(): search = search.cleaned_data['search_field'] users = User.objects.filter(Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) + connexion = [] + for user in users: + connexion.append([user, has_access(user)]) machines = None query = Q(user__pseudo__icontains = search) | Q(user__name__icontains = search) | Q(user__surname__icontains = search) factures = Facture.objects.filter(query) bans = Ban.objects.filter(query) - return form({'users_list': users, 'machine_list' : machines, 'facture_list' : factures, 'ban_list' : bans}, 'search/index.html',request) + return form({'users_list': connexion, 'machine_list' : machines, 'facture_list' : factures, 'ban_list' : bans}, 'search/index.html',request) return form({'searchform' : search}, 'search/search.html', request) else: search = SearchForm(request.POST or None) diff --git a/users/__pycache__/views.cpython-34.pyc b/users/__pycache__/views.cpython-34.pyc index ddf075bd..d2630750 100644 Binary files a/users/__pycache__/views.cpython-34.pyc and b/users/__pycache__/views.cpython-34.pyc differ diff --git a/users/templates/users/aff_users.html b/users/templates/users/aff_users.html index ed17f82e..d9cfaab7 100644 --- a/users/templates/users/aff_users.html +++ b/users/templates/users/aff_users.html @@ -5,27 +5,25 @@