Renaming custom field causes IntegrityError #20143
Unanswered
llamafilm
asked this question in
Help Wanted!
Replies: 1 comment
-
I found a workaround, after creating that key with a null value on all devices, then I can rename the custom field in the UI. for dev in Device.objects.exclude(custom_field_data__has_key='password'):
dev.custom_field_data['password'] = None
dev.full_clean()
dev.save() I'm curious, why doesn't Netbox create keys with null values automatically when creating a new device? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I tried renaming a custom field today, it threw this exception.
After some debugging, I believe this is the SQL query that causes the error:
I have many devices where that
password
custom field does not exist. I'm guessing this probably happens when creating devices using custom scripts (which I do often), if those fields are omitted.I'm not sure how to solve this. Should I do something differently, or should something be fixed in Netbox? I'm on v4.3.2.
Beta Was this translation helpful? Give feedback.
All reactions