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):
239
239
host_type : [error_same_acl_name ],
240
240
"name" : [error_same_acl_name ],
241
241
}
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 (
245
245
acl_type == ACLTypeChoices .TYPE_EXTENDED
246
246
and self .instance .aclstandardrules .exists ()
247
- ) or (
247
+ )
248
+ or (
248
249
acl_type == ACLTypeChoices .TYPE_STANDARD
249
250
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
+ ]
254
256
255
257
if error_message :
256
258
raise forms .ValidationError (error_message )
You can’t perform that action at this time.
0 commit comments