[GrandComicsDatabase/gcd-django] Honor approver collapse preference in review email (PR #751)

2 views
Skip to first unread message

jhunterjActual

unread,
Sep 2, 2026, 4:10:00 PM (3 days ago) Sep 2
to GrandComicsDatabase/gcd-django, Subscribed

Summary

  • honor the assigned approver's collapsed compare-view preference in the “GCD change to review” email
  • preserve the existing expanded link when that preference is disabled
  • document that the compare route currently has no query parameters and must merge any future ones
  • add regression coverage for both preference values

Testing

  • pytest gcd-django/apps/oi/tests/test_views.py
  • python manage.py check
  • python -m flake8 apps/oi/views.py apps/oi/tests/test_views.py
  • git diff --check
  • mounted runtime health check returned HTTP 200

You can view, comment on, or merge this pull request online at:

  https://github.com/GrandComicsDatabase/gcd-django/pull/751

Commit Summary

  • 2da70ca Honor approver collapse preference in review email

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751@github.com>

gemini-code-assist[bot]

unread,
Sep 2, 2026, 4:11:29 PM (3 days ago) Sep 2
to GrandComicsDatabase/gcd-django, Subscribed

@gemini-code-assist[bot] commented on this pull request.

Code Review

This pull request updates the submission email logic to respect the approver's preference for collapsing the compare view by appending ?collapse=1 to the comparison URL when enabled, and adds a corresponding test case. The review feedback suggests adding a defensive check to ensure the approver has an associated Indexer profile before accessing its attributes, preventing potential RelatedObjectDoesNotExist exceptions.


In apps/oi/views.py:

> @@ -579,6 +579,12 @@ def submit(request, id):
                       comment_text
         else:
             comment = ''
+        compare_url = settings.SITE_URL.rstrip('/') + urlresolvers.reverse(
+          'compare', kwargs={'id': changeset.id})
+        if changeset.approver.indexer.collapse_compare_view:

medium

If the assigned approver (changeset.approver) does not have an associated Indexer profile (for example, if they are a newly created user or a system user without a profile), accessing changeset.approver.indexer will raise a RelatedObjectDoesNotExist exception, leading to a 500 error during submission.\n\nUsing a defensive check like hasattr(changeset.approver, 'indexer') prevents this potential crash.

⬇️ Suggested change
-        if changeset.approver.indexer.collapse_compare_view:
+        if hasattr(changeset.approver, 'indexer') and changeset.approver.indexer.collapse_compare_view:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751/review/5094586378@github.com>

jhunterjActual

unread,
Sep 2, 2026, 4:23:13 PM (3 days ago) Sep 2
to GrandComicsDatabase/gcd-django, Push

@jhunterjActual pushed 1 commit.

  • 319ca09 Honor approver collapse preference in review email


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751/before/2da70cac2e0b0bff322ed559301276bd565872d8/after/319ca0964a15eefacf0a2f633b875145c95025be@github.com>

jhunterjActual

unread,
Sep 2, 2026, 4:28:20 PM (3 days ago) Sep 2
to GrandComicsDatabase/gcd-django, Subscribed

@jhunterjActual commented on this pull request.


In apps/oi/views.py:

> @@ -579,6 +579,12 @@ def submit(request, id):
                       comment_text
         else:
             comment = ''
+        compare_url = settings.SITE_URL.rstrip('/') + urlresolvers.reverse(
+          'compare', kwargs={'id': changeset.id})
+        if changeset.approver.indexer.collapse_compare_view:

Incorporated with 319ca09


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751/review/5094739154@github.com>

JochenGCD

unread,
Sep 2, 2026, 4:31:28 PM (3 days ago) Sep 2
to GrandComicsDatabase/gcd-django, Subscribed

@jochengcd commented on this pull request.


In apps/oi/views.py:

> @@ -579,6 +579,12 @@ def submit(request, id):
                       comment_text
         else:
             comment = ''
+        compare_url = settings.SITE_URL.rstrip('/') + urlresolvers.reverse(
+          'compare', kwargs={'id': changeset.id})
+        if changeset.approver.indexer.collapse_compare_view:

This cannot happen, an approver always has an indexer. It doesn't really hurt to do the check, but is unneeded code which one could stumble over.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751/review/5094766868@github.com>

JochenGCD

unread,
Sep 3, 2026, 4:22:31 AM (2 days ago) Sep 3
to GrandComicsDatabase/gcd-django, Subscribed

Merged #751 into beta.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/751/issue_event/30473777304@github.com>

Reply all
Reply to author
Forward
0 new messages