mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #5273: Fix exception when validating a new permission with no models selected
This commit is contained in:
@ -6,6 +6,7 @@
|
|||||||
* [#3672](https://github.com/netbox-community/netbox/issues/3672) - Fix a caching issue causing incorrect related object counts in API responses
|
* [#3672](https://github.com/netbox-community/netbox/issues/3672) - Fix a caching issue causing incorrect related object counts in API responses
|
||||||
* [#5113](https://github.com/netbox-community/netbox/issues/5113) - Fix incorrect caching of permission object assignments to user groups in the admin panel
|
* [#5113](https://github.com/netbox-community/netbox/issues/5113) - Fix incorrect caching of permission object assignments to user groups in the admin panel
|
||||||
* [#5243](https://github.com/netbox-community/netbox/issues/5243) - Redirect user to appropriate tab after modifying device components
|
* [#5243](https://github.com/netbox-community/netbox/issues/5243) - Redirect user to appropriate tab after modifying device components
|
||||||
|
* [#5273](https://github.com/netbox-community/netbox/issues/5273) - Fix exception when validating a new permission with no models selected
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class ObjectPermissionForm(forms.ModelForm):
|
|||||||
|
|
||||||
# Validate the specified model constraints by attempting to execute a query. We don't care whether the query
|
# Validate the specified model constraints by attempting to execute a query. We don't care whether the query
|
||||||
# returns anything; we just want to make sure the specified constraints are valid.
|
# returns anything; we just want to make sure the specified constraints are valid.
|
||||||
if constraints:
|
if object_types and constraints:
|
||||||
# Normalize the constraints to a list of dicts
|
# Normalize the constraints to a list of dicts
|
||||||
if type(constraints) is not list:
|
if type(constraints) is not list:
|
||||||
constraints = [constraints]
|
constraints = [constraints]
|
||||||
|
Reference in New Issue
Block a user