mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-26 08:53:46 +00:00
Restriction sur l'ajout des machines en attendant qu'on décide de limites
This commit is contained in:
parent
a09c7d0943
commit
c5c92ab20d
1 changed files with 8 additions and 0 deletions
|
@ -81,6 +81,7 @@ def form(ctx, template, request):
|
||||||
return render_to_response(template, c, context_instance=RequestContext(request))
|
return render_to_response(template, c, context_instance=RequestContext(request))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def new_machine(request, userid):
|
def new_machine(request, userid):
|
||||||
try:
|
try:
|
||||||
user = User.objects.get(pk=userid)
|
user = User.objects.get(pk=userid)
|
||||||
|
@ -115,6 +116,7 @@ def new_machine(request, userid):
|
||||||
return form({'machineform': machine, 'interfaceform': interface}, 'machines/machine.html', request)
|
return form({'machineform': machine, 'interfaceform': interface}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def edit_interface(request, interfaceid):
|
def edit_interface(request, interfaceid):
|
||||||
try:
|
try:
|
||||||
interface = Interface.objects.get(pk=interfaceid)
|
interface = Interface.objects.get(pk=interfaceid)
|
||||||
|
@ -147,6 +149,7 @@ def edit_interface(request, interfaceid):
|
||||||
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
|
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def del_machine(request, machineid):
|
def del_machine(request, machineid):
|
||||||
try:
|
try:
|
||||||
machine = Machine.objects.get(pk=machineid)
|
machine = Machine.objects.get(pk=machineid)
|
||||||
|
@ -166,6 +169,7 @@ def del_machine(request, machineid):
|
||||||
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
|
||||||
|
@permission_required('cableur')
|
||||||
def new_interface(request, machineid):
|
def new_interface(request, machineid):
|
||||||
try:
|
try:
|
||||||
machine = Machine.objects.get(pk=machineid)
|
machine = Machine.objects.get(pk=machineid)
|
||||||
|
@ -194,6 +198,7 @@ def new_interface(request, machineid):
|
||||||
return form({'interfaceform': interface_form}, 'machines/machine.html', request)
|
return form({'interfaceform': interface_form}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def del_interface(request, interfaceid):
|
def del_interface(request, interfaceid):
|
||||||
try:
|
try:
|
||||||
interface = Interface.objects.get(pk=interfaceid)
|
interface = Interface.objects.get(pk=interfaceid)
|
||||||
|
@ -453,6 +458,7 @@ def del_ns(request):
|
||||||
return form({'machineform': ns, 'interfaceform': None}, 'machines/machine.html', request)
|
return form({'machineform': ns, 'interfaceform': None}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def add_alias(request, interfaceid):
|
def add_alias(request, interfaceid):
|
||||||
try:
|
try:
|
||||||
interface = Interface.objects.get(pk=interfaceid)
|
interface = Interface.objects.get(pk=interfaceid)
|
||||||
|
@ -475,6 +481,7 @@ def add_alias(request, interfaceid):
|
||||||
return form({'machineform': alias, 'interfaceform': None}, 'machines/machine.html', request)
|
return form({'machineform': alias, 'interfaceform': None}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def edit_alias(request, aliasid):
|
def edit_alias(request, aliasid):
|
||||||
try:
|
try:
|
||||||
alias_instance = Alias.objects.get(pk=aliasid)
|
alias_instance = Alias.objects.get(pk=aliasid)
|
||||||
|
@ -495,6 +502,7 @@ def edit_alias(request, aliasid):
|
||||||
return form({'machineform': alias}, 'machines/machine.html', request)
|
return form({'machineform': alias}, 'machines/machine.html', request)
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@permission_required('cableur')
|
||||||
def del_alias(request, interfaceid):
|
def del_alias(request, interfaceid):
|
||||||
try:
|
try:
|
||||||
interface = Interface.objects.get(pk=interfaceid)
|
interface = Interface.objects.get(pk=interfaceid)
|
||||||
|
|
Loading…
Reference in a new issue