mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
12795 update migration
This commit is contained in:
parent
edf0dd68dc
commit
ae454a8a0e
@ -12,6 +12,12 @@ def update_content_types(apps, schema_editor):
|
||||
# that any foreign key references are preserved
|
||||
ContentType.objects.filter(app_label='auth', model='user').update(app_label='users')
|
||||
|
||||
netboxuser_ct = ContentType.objects.filter(app_label='users', model='netboxuser').first()
|
||||
if netboxuser_ct:
|
||||
user_ct = ContentType.objects.filter(app_label='users', model='user').first()
|
||||
CustomField = apps.get_model('extras', 'CustomField')
|
||||
CustField.objects.filter(object_type_id=netboxuser_ct.id).update(object_type_id=user_ct.id)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user