mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
fixes contact assignments filter to include parent content type #12730
This commit is contained in:
parent
f3337db5a2
commit
e90f0e6e0b
@ -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