mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #4183: Fix representation of NaturalOrderingField values in change log
This commit is contained in:
@ -10,6 +10,7 @@
|
|||||||
* [#2519](https://github.com/netbox-community/netbox/issues/2519) - Avoid race condition when provisioning "next available" IPs/prefixes via the API
|
* [#2519](https://github.com/netbox-community/netbox/issues/2519) - Avoid race condition when provisioning "next available" IPs/prefixes via the API
|
||||||
* [#4168](https://github.com/netbox-community/netbox/issues/4168) - Role is not required when creating a virtual machine
|
* [#4168](https://github.com/netbox-community/netbox/issues/4168) - Role is not required when creating a virtual machine
|
||||||
* [#4175](https://github.com/netbox-community/netbox/issues/4175) - Fix potential exception when bulk editing objects from a filtered list
|
* [#4175](https://github.com/netbox-community/netbox/issues/4175) - Fix potential exception when bulk editing objects from a filtered list
|
||||||
|
* [#4183](https://github.com/netbox-community/netbox/issues/4183) - Fix representation of NaturalOrderingField values in change log
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -56,8 +56,11 @@ class NaturalOrderingField(models.CharField):
|
|||||||
"""
|
"""
|
||||||
Generate a naturalized value from the target field
|
Generate a naturalized value from the target field
|
||||||
"""
|
"""
|
||||||
value = getattr(model_instance, self.target_field)
|
original_value = getattr(model_instance, self.target_field)
|
||||||
return self.naturalize_function(value, max_length=self.max_length)
|
naturalized_value = self.naturalize_function(original_value, max_length=self.max_length)
|
||||||
|
setattr(model_instance, self.attname, naturalized_value)
|
||||||
|
|
||||||
|
return naturalized_value
|
||||||
|
|
||||||
def deconstruct(self):
|
def deconstruct(self):
|
||||||
kwargs = super().deconstruct()[3] # Pass kwargs from CharField
|
kwargs = super().deconstruct()[3] # Pass kwargs from CharField
|
||||||
|
Reference in New Issue
Block a user