diff --git a/machines/views.py b/machines/views.py
index 7abb8182..b89e9e71 100644
--- a/machines/views.py
+++ b/machines/views.py
@@ -47,7 +47,7 @@ def edit_machine(request, interfaceid):
machine_form.save()
interface_form.save()
messages.success(request, "La machine a été modifiée")
- return redirect("/users/")
+ return redirect("/machines/")
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
def new_interface(request, machineid):
@@ -64,7 +64,7 @@ def new_interface(request, machineid):
new_interface.machine = machine
new_interface.save()
messages.success(request, "L'interface a été ajoutée")
- return redirect("/users/")
+ return redirect("/machines/")
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
def index(request):
diff --git a/templates/base.html b/templates/base.html
index 8142bc93..057a8905 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -28,7 +28,7 @@
- Adhérents
- - Machines
+ - Machines
- Cotisations
- Topologie
- Statistiques
diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html
index e00b60c8..1a41332c 100644
--- a/users/templates/users/profil.html
+++ b/users/templates/users/profil.html
@@ -6,7 +6,7 @@
{% block content %}
Adhérent
Editer
- Changer le mot de passe
+ Changer le mot de passe
Changer le statut
@@ -66,8 +66,9 @@
{% endif %}
Machines :
+
{% if machine_list %}
-
+ {% include "machines/aff_machines.html" with machine_list=machine_list %}
{% else %}
Aucune machine
{% endif %}
@@ -79,7 +80,7 @@
Aucune facture
{% endif %}
Bannissements :
-
+
{% if ban_list %}
{% include "users/aff_bans.html" with ban_list=ban_list %}
{% else %}
diff --git a/users/views.py b/users/views.py
index 0bb8fd16..813f1fdc 100644
--- a/users/views.py
+++ b/users/views.py
@@ -11,7 +11,7 @@ from django.utils import timezone
from users.models import User, Right, Ban, DelRightForm, UserForm, InfoForm, PasswordForm, StateForm, RightForm, BanForm, ProfilForm
from cotisations.models import Facture
-from machines.models import Machine
+from machines.models import Machine, Interface
from users.forms import PassForm
from search.models import SearchForm
from cotisations.views import is_adherent, end_adhesion
@@ -156,7 +156,7 @@ def profil(request):
if profil.is_valid():
profils = profil.cleaned_data['user']
users = User.objects.get(pseudo = profils)
- machines = None
+ machines = Interface.objects.filter(machine=Machine.objects.filter(user__pseudo = users))
factures = Facture.objects.filter(user__pseudo = users)
bans = Ban.objects.filter(user__pseudo = users)
end = None