mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Rename ContactAssignment.content_type to object_type
This commit is contained in:
@@ -292,7 +292,7 @@ class ContactAssignmentTestCase(
|
||||
tags = create_tags('Alpha', 'Bravo', 'Charlie')
|
||||
|
||||
cls.form_data = {
|
||||
'content_type': ContentType.objects.get_for_model(Site).pk,
|
||||
'object_type': ContentType.objects.get_for_model(Site).pk,
|
||||
'object_id': sites[3].pk,
|
||||
'contact': contacts[3].pk,
|
||||
'role': contact_roles[3].pk,
|
||||
@@ -306,11 +306,11 @@ class ContactAssignmentTestCase(
|
||||
}
|
||||
|
||||
def _get_url(self, action, instance=None):
|
||||
# Override creation URL to append content_type & object_id parameters
|
||||
# Override creation URL to append object_type & object_id parameters
|
||||
if action == 'add':
|
||||
url = reverse('tenancy:contactassignment_add')
|
||||
content_type = ContentType.objects.get_for_model(Site).pk
|
||||
object_id = Site.objects.first().pk
|
||||
return f"{url}?content_type={content_type}&object_id={object_id}"
|
||||
return f"{url}?object_type={content_type}&object_id={object_id}"
|
||||
|
||||
return super()._get_url(action, instance=instance)
|
||||
|
||||
Reference in New Issue
Block a user