Fixes #21020: Fix object filtering for image attachments panel (#21030)

This commit is contained in:
Jeremy Stretch
2025-12-29 16:19:24 -05:00
committed by GitHub
parent edf35e35be
commit c78b8401dc

View File

@@ -51,7 +51,14 @@ class ImageAttachmentsPanel(panels.ObjectsTablePanel):
] ]
def __init__(self, **kwargs): def __init__(self, **kwargs):
super().__init__('extras.imageattachment', **kwargs) super().__init__(
'extras.imageattachment',
filters={
'object_type_id': lambda ctx: ContentType.objects.get_for_model(ctx['object']).pk,
'object_id': lambda ctx: ctx['object'].pk,
},
**kwargs,
)
class TagsPanel(panels.ObjectPanel): class TagsPanel(panels.ObjectPanel):