mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
custom_deconstruct() should not ignore TimeZoneField
This commit is contained in:
parent
f49819ebc2
commit
f48d1c9410
@ -1,5 +1,4 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from timezone_field import TimeZoneField
|
|
||||||
|
|
||||||
from netbox.config import ConfigItem
|
from netbox.config import ConfigItem
|
||||||
|
|
||||||
@ -8,10 +7,6 @@ __all__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
SKIP_FIELDS = (
|
|
||||||
TimeZoneField,
|
|
||||||
)
|
|
||||||
|
|
||||||
EXEMPT_ATTRS = (
|
EXEMPT_ATTRS = (
|
||||||
'choices',
|
'choices',
|
||||||
'help_text',
|
'help_text',
|
||||||
@ -28,9 +23,8 @@ def custom_deconstruct(field):
|
|||||||
name, path, args, kwargs = _deconstruct(field)
|
name, path, args, kwargs = _deconstruct(field)
|
||||||
|
|
||||||
# Remove any ignored attributes
|
# Remove any ignored attributes
|
||||||
if field.__class__ not in SKIP_FIELDS:
|
for attr in EXEMPT_ATTRS:
|
||||||
for attr in EXEMPT_ATTRS:
|
kwargs.pop(attr, None)
|
||||||
kwargs.pop(attr, None)
|
|
||||||
|
|
||||||
# Ignore any field defaults which reference a ConfigItem
|
# Ignore any field defaults which reference a ConfigItem
|
||||||
kwargs = {
|
kwargs = {
|
||||||
|
Loading…
Reference in New Issue
Block a user