Skip to content

Commit

Permalink
#15357: Rename CustomField object_type to related_object_type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Mar 11, 2024
1 parent 78dd652 commit 21de3f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netbox/users/migrations/0005_alter_user_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update_content_types(apps, schema_editor):
if netboxuser_ct:
user_ct = ContentType.objects.filter(app_label='users', model='user').first()
CustomField = apps.get_model('extras', 'CustomField')
CustomField.objects.filter(object_type_id=netboxuser_ct.id).update(object_type_id=user_ct.id)
CustomField.objects.filter(related_object_type_id=netboxuser_ct.id).update(related_object_type_id=user_ct.id)
netboxuser_ct.delete()


Expand Down
2 changes: 1 addition & 1 deletion netbox/users/migrations/0006_custom_group_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def update_custom_fields(apps, schema_editor):

if old_ct := ContentType.objects.filter(app_label='users', model='netboxgroup').first():
new_ct = ContentType.objects.get_for_model(Group)
CustomField.objects.filter(object_type=old_ct).update(object_type=new_ct)
CustomField.objects.filter(related_object_type=old_ct).update(related_object_type=new_ct)


class Migration(migrations.Migration):
Expand Down

0 comments on commit 21de3f9

Please sign in to comment.