Skip to content

Add event to addon run serializer#364

Merged
eyeseast merged 2 commits intomasterfrom
363-addon-run-event
Feb 11, 2026
Merged

Add event to addon run serializer#364
eyeseast merged 2 commits intomasterfrom
363-addon-run-event

Conversation

@eyeseast
Copy link
Contributor

Closes #363

Precursor to this issue MuckRock/documentcloud-frontend#629

queryset = AddOnRun.objects.none()
lookup_field = "uuid"
permit_list_expands = ["addon"]
permit_list_expands = ["addon", "event"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchelljkotler Any thoughts on the performance implications of this change? Probably want to use select_related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that go on the queryset right above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for catching this @duckduckgrayduck

No, the queryset above is over written in the get_queryset` method. I left a comment in the appropriate spot.

def get_queryset(self):
"""Only fetch add-on runs viewable to this user"""
queryset = AddOnRun.objects.get_viewable(self.request.user)
if is_expanded(self.request, "addon"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eyeseast - the code would go here - you can do the same check for addon for event

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had just found that on my own. It's updated now.

queryset = AddOnRun.objects.none()
lookup_field = "uuid"
permit_list_expands = ["addon"]
permit_list_expands = ["addon", "event"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for catching this @duckduckgrayduck

No, the queryset above is over written in the get_queryset` method. I left a comment in the appropriate spot.

@eyeseast eyeseast merged commit 501f222 into master Feb 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add event ID to add-on run serializer

3 participants