mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 22:52:26 +00:00
Retour sur le profil de l'utilisateur apres suppression machine
Conflicts: machines/views.py
This commit is contained in:
parent
50921b01d8
commit
db7c9a1b76
1 changed files with 6 additions and 2 deletions
|
@ -127,6 +127,7 @@ def new_machine(request, userid):
|
||||||
reversion.set_user(request.user)
|
reversion.set_user(request.user)
|
||||||
reversion.set_comment("Création")
|
reversion.set_comment("Création")
|
||||||
messages.success(request, "La machine a été crée")
|
messages.success(request, "La machine a été crée")
|
||||||
|
<<<<<<< HEAD
|
||||||
return redirect("/users/profil/" + userid)
|
return redirect("/users/profil/" + userid)
|
||||||
=======
|
=======
|
||||||
try:
|
try:
|
||||||
|
@ -165,6 +166,9 @@ def new_machine(request, userid):
|
||||||
except TypeError:
|
except TypeError:
|
||||||
messages.error(request, u"Adresse mac invalide")
|
messages.error(request, u"Adresse mac invalide")
|
||||||
>>>>>>> b660cf0... Prise en compte des erreurs sur la mac
|
>>>>>>> b660cf0... Prise en compte des erreurs sur la mac
|
||||||
|
=======
|
||||||
|
return redirect("/users/profil/" + user)
|
||||||
|
>>>>>>> 9b69205... Retour sur le profil de l'utilisateur apres suppression machine
|
||||||
return form({'machineform': machine, 'interfaceform': interface, 'domainform': domain}, 'machines/machine.html', request)
|
return form({'machineform': machine, 'interfaceform': interface, 'domainform': domain}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -256,13 +260,13 @@ def del_machine(request, machineid):
|
||||||
if not request.user.has_perms(('cableur',)):
|
if not request.user.has_perms(('cableur',)):
|
||||||
if machine.user != request.user:
|
if machine.user != request.user:
|
||||||
messages.error(request, "Vous ne pouvez pas éditer une machine d'un autre user que vous sans droit")
|
messages.error(request, "Vous ne pouvez pas éditer une machine d'un autre user que vous sans droit")
|
||||||
return redirect("/users/profil/" + str(request.user.id))
|
return redirect("/users/profil/" + str(machine.user.id))
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
with transaction.atomic(), reversion.create_revision():
|
with transaction.atomic(), reversion.create_revision():
|
||||||
machine.delete()
|
machine.delete()
|
||||||
reversion.set_user(request.user)
|
reversion.set_user(request.user)
|
||||||
messages.success(request, "La machine a été détruite")
|
messages.success(request, "La machine a été détruite")
|
||||||
return redirect("/users/profil/" + str(request.user.id))
|
return redirect("/users/profil/" + str(machine.user.id))
|
||||||
return form({'objet': machine, 'objet_name': 'machine'}, 'machines/delete.html', request)
|
return form({'objet': machine, 'objet_name': 'machine'}, 'machines/delete.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in a new issue