Make /issue_list/ endpoints support conditional requests#476
Merged
bpepple merged 2 commits intoMetron-Project:masterfrom Mar 11, 2026
Merged
Make /issue_list/ endpoints support conditional requests#476bpepple merged 2 commits intoMetron-Project:masterfrom
bpepple merged 2 commits intoMetron-Project:masterfrom
Conversation
- Fix IssueListMixin._issue_list to use self.request in serializer context instead of the (incorrectly bound) request parameter, ensuring image URLs are generated correctly - Update update_series_modified_on_issue_save to bump the series modified timestamp on every issue save, not just on creation, so the series issue_list Last-Modified header stays accurate after issue edits - Handle post_clear in update_related_modified so that clearing issues from a parent object (arc.issues.clear(), etc.) invalidates the parent's cached response; document that the issue-side clear remains a no-op since pk_set is None - Add tests for post_clear behaviour (parent-side updates, issue-side is a no-op) and update test_issue_save_does_not_update_series_on_update to reflect the corrected save behaviour - Remove unused issue_with_arc fixture from test_character_issue_list_conditional_request_returns_304
bpepple
approved these changes
Mar 11, 2026
Member
bpepple
left a comment
There was a problem hiding this comment.
Looks good. Made a couple of minor changes:
- Fixed the IssueListMixin._issue_list serializer context to use
self.request. - Modified
update_series_modified_on_issue_saveto update the series modified timestamp on every issue save, not just on creation, so the series issue_list Last-Modified header stays accurate after issue edits. - Updated
post_clear in update_related_modifiedso that clearing issues from a parent object (arc.issues.clear(), etc.) invalidates the parent's cached response - Added/Updated a couple of tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR make all
/issue_list/endpoints support conditional requests by using themodifiedfield of the parent model.Since the
modifiedfield is currently only updated when the parent model itself changes, this PR adds signals to the relevant models which updates themodifiedfield on them when issues are added or removed to their relationship. I think this change tomodifiedmakes sense semantically since the model is modified when its relationships are changed. It's especially true for theSeriesmodel which currently will return a304even if theissue_countproperty has changed since theIf-Modified-Sincedate due to themodifiedof the series not changing when an issue is added or removed.