mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 03:43:12 +00:00
Ne permet pas de sauvegarder de liste de ports vides.
This commit is contained in:
parent
b95c19db2d
commit
9fcecad007
1 changed files with 7 additions and 3 deletions
|
@ -932,7 +932,9 @@ def edit_portlist(request, pk):
|
||||||
Port,
|
Port,
|
||||||
fields=('begin','end','protocole','io'),
|
fields=('begin','end','protocole','io'),
|
||||||
extra=0,
|
extra=0,
|
||||||
can_delete=True
|
can_delete=True,
|
||||||
|
min_num=1,
|
||||||
|
validate_min=True,
|
||||||
)(request.POST or None, queryset=port_list_instance.port_set.all())
|
)(request.POST or None, queryset=port_list_instance.port_set.all())
|
||||||
if port_list.is_valid() and port_formset.is_valid():
|
if port_list.is_valid() and port_formset.is_valid():
|
||||||
pl = port_list.save()
|
pl = port_list.save()
|
||||||
|
@ -968,8 +970,10 @@ def add_portlist(request):
|
||||||
port_formset = modelformset_factory(
|
port_formset = modelformset_factory(
|
||||||
Port,
|
Port,
|
||||||
fields=('begin','end','protocole','io'),
|
fields=('begin','end','protocole','io'),
|
||||||
extra=1,
|
extra=0,
|
||||||
can_delete=True
|
can_delete=True,
|
||||||
|
min_num=1,
|
||||||
|
validate_min=True,
|
||||||
)(request.POST or None, queryset=Port.objects.none())
|
)(request.POST or None, queryset=Port.objects.none())
|
||||||
if port_list.is_valid() and port_formset.is_valid():
|
if port_list.is_valid() and port_formset.is_valid():
|
||||||
pl = port_list.save()
|
pl = port_list.save()
|
||||||
|
|
Loading…
Reference in a new issue