File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -239,18 +239,20 @@ def clean(self):
239239 host_type : [error_same_acl_name ],
240240 "name" : [error_same_acl_name ],
241241 }
242- if self . instance . pk :
243- # Check if Access List has no existing rules before change the Access List's type.
244- if (
242+ if (
243+ self . instance . pk
244+ and (
245245 acl_type == ACLTypeChoices .TYPE_EXTENDED
246246 and self .instance .aclstandardrules .exists ()
247- ) or (
247+ )
248+ or (
248249 acl_type == ACLTypeChoices .TYPE_STANDARD
249250 and self .instance .aclextendedrules .exists ()
250- ):
251- error_message ["type" ] = [
252- "This ACL has ACL rules associated, CANNOT change ACL type." ,
253- ]
251+ )
252+ ):
253+ error_message ["type" ] = [
254+ "This ACL has ACL rules associated, CANNOT change ACL type." ,
255+ ]
254256
255257 if error_message :
256258 raise forms .ValidationError (error_message )
You can’t perform that action at this time.
0 commit comments