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 @@ -230,18 +230,20 @@ def clean(self):
230
230
host_type : [error_same_acl_name ],
231
231
"name" : [error_same_acl_name ],
232
232
}
233
- if self . instance . pk :
234
- # Check if Access List has no existing rules before change the Access List's type.
235
- if (
233
+ if (
234
+ self . instance . pk
235
+ and (
236
236
acl_type == ACLTypeChoices .TYPE_EXTENDED
237
237
and self .instance .aclstandardrules .exists ()
238
- ) or (
238
+ )
239
+ or (
239
240
acl_type == ACLTypeChoices .TYPE_STANDARD
240
241
and self .instance .aclextendedrules .exists ()
241
- ):
242
- error_message ["type" ] = [
243
- "This ACL has ACL rules associated, CANNOT change ACL type." ,
244
- ]
242
+ )
243
+ ):
244
+ error_message ["type" ] = [
245
+ "This ACL has ACL rules associated, CANNOT change ACL type." ,
246
+ ]
245
247
246
248
if error_message :
247
249
raise forms .ValidationError (error_message )
You can’t perform that action at this time.
0 commit comments