@@ -214,7 +214,7 @@ def get_host_types(self):
214
214
215
215
def validate_host_types (self , host_types ):
216
216
"""
217
- Check if more than one host type selected.
217
+ Check number of host types selected.
218
218
"""
219
219
if len (host_types ) > 1 :
220
220
raise forms .ValidationError (
@@ -434,19 +434,19 @@ def clean(self):
434
434
assigned_object_type : [error_acl_not_assigned_to_host ],
435
435
host_type : [error_acl_not_assigned_to_host ],
436
436
}
437
- ## Check for duplicate entry.
438
- # if ACLInterfaceAssignment.objects.filter(
439
- # access_list=access_list,
440
- # assigned_object_id=assigned_object_id,
441
- # assigned_object_type=assigned_object_type_id,
442
- # direction=direction,
443
- # ).exists():
444
- # error_duplicate_entry = "An ACL with this name is already associated to this interface & direction."
445
- # error_message |= {
446
- # "access_list": [error_duplicate_entry],
447
- # "direction": [error_duplicate_entry],
448
- # assigned_object_type: [error_duplicate_entry],
449
- # }
437
+ # Check for duplicate entry.
438
+ if ACLInterfaceAssignment .objects .filter (
439
+ access_list = access_list ,
440
+ assigned_object_id = assigned_object_id ,
441
+ assigned_object_type = assigned_object_type_id ,
442
+ direction = direction ,
443
+ ).exists ():
444
+ error_duplicate_entry = "An ACL with this name is already associated to this interface & direction."
445
+ error_message |= {
446
+ "access_list" : [error_duplicate_entry ],
447
+ "direction" : [error_duplicate_entry ],
448
+ assigned_object_type : [error_duplicate_entry ],
449
+ }
450
450
# Check that the interface does not have an existing ACL applied in the direction already.
451
451
if ACLInterfaceAssignment .objects .filter (
452
452
assigned_object_id = assigned_object_id ,
0 commit comments