mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #6131: Correct handling of boolean fields when cloning objects
This commit is contained in:
parent
4dfba3a2ad
commit
2cc088c633
@ -16,6 +16,7 @@
|
||||
* [#6073](https://github.com/netbox-community/netbox/issues/6073) - Permit users to manage their own REST API tokens without needing explicit permission
|
||||
* [#6081](https://github.com/netbox-community/netbox/issues/6081) - Fix interface connections REST API endpoint
|
||||
* [#6108](https://github.com/netbox-community/netbox/issues/6108) - Do not infer tenant assignment from parent objects for prefixes, IP addresses
|
||||
* [#6131](https://github.com/netbox-community/netbox/issues/6131) - Correct handling of boolean fields when cloning objects
|
||||
|
||||
---
|
||||
|
||||
|
@ -224,12 +224,12 @@ def prepare_cloned_fields(instance):
|
||||
field = instance._meta.get_field(field_name)
|
||||
field_value = field.value_from_object(instance)
|
||||
|
||||
# Swap out False with URL-friendly value
|
||||
# Pass False as null for boolean fields
|
||||
if field_value is False:
|
||||
field_value = ''
|
||||
params.append((field_name, ''))
|
||||
|
||||
# Omit empty values
|
||||
if field_value not in (None, ''):
|
||||
elif field_value not in (None, ''):
|
||||
params.append((field_name, field_value))
|
||||
|
||||
# Copy tags
|
||||
|
Loading…
Reference in New Issue
Block a user