mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 12:42:52 -06:00
fixes contact assignments filter to include parent content type #12730
This commit is contained in:
parent
b64b19a3f4
commit
e2f9a3c07a
@ -29,7 +29,10 @@ class ObjectContactsView(generic.ObjectChildrenView):
|
||||
def get_children(self, request, parent):
|
||||
return Contact.objects.annotate(
|
||||
assignment_count=count_related(ContactAssignment, 'contact')
|
||||
).restrict(request.user, 'view').filter(assignments__object_id=parent.pk)
|
||||
).restrict(request.user, 'view').filter(
|
||||
assignments__content_type=ContentType.objects.get_for_model(parent),
|
||||
assignments__object_id=parent.pk
|
||||
)
|
||||
|
||||
def get_extra_context(self, request, instance):
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user