mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 06:32:26 +00:00
Dégage filtre de mac valide inutile et incomplet
This commit is contained in:
parent
b53c502498
commit
6dbfbb894a
1 changed files with 0 additions and 6 deletions
|
@ -60,12 +60,6 @@ class EditInterfaceForm(ModelForm):
|
||||||
if "machine" in self.fields:
|
if "machine" in self.fields:
|
||||||
self.fields['machine'].queryset = Machine.objects.all().select_related('user')
|
self.fields['machine'].queryset = Machine.objects.all().select_related('user')
|
||||||
|
|
||||||
def clean(self):
|
|
||||||
data = super(EditInterfaceForm, self).clean()
|
|
||||||
mac = str(self.data['mac_address'])
|
|
||||||
if len(''.join(mac.replace("-",":").split(":"))) != 12:
|
|
||||||
self.add_error('mac_address', "Format de la mac incorrect")
|
|
||||||
|
|
||||||
class AddInterfaceForm(EditInterfaceForm):
|
class AddInterfaceForm(EditInterfaceForm):
|
||||||
class Meta(EditInterfaceForm.Meta):
|
class Meta(EditInterfaceForm.Meta):
|
||||||
fields = ['ipv4','mac_address','type','details']
|
fields = ['ipv4','mac_address','type','details']
|
||||||
|
|
Loading…
Reference in a new issue