[GrandComicsDatabase/gcd-django] filter the character names when a group is selected (PR #721)

8 views
Skip to first unread message

jhunterjActual

unread,
Jun 19, 2026, 9:50:32 AM (9 days ago) Jun 19
to GrandComicsDatabase/gcd-django, Subscribed

Currently the code the checks the group membership for characters when saving a sequence and errors if a character is submitted with a group it isn't a member of. Improve user experience by filtering the characters by the group if the group is entered first, just like the groups are filtered by the character if the character is entered first.


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

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

Commit Summary

  • f92f0a3 filter the character names when a group is selected

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/721@github.com>

gemini-code-assist[bot]

unread,
Jun 19, 2026, 9:51:46 AM (9 days ago) Jun 19
to GrandComicsDatabase/gcd-django, Subscribed

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

Code Review

This pull request updates the character autocomplete widget to forward the 'group_name' field and modifies the queryset filtering in 'apps/select/views.py' to support list-based filtering. A critical indentation error was identified in the view changes that would lead to a runtime error, along with a suggestion to filter out empty values from the 'group_name' list.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


In apps/select/views.py:

> +             if not isinstance(group_name, list):
+                group_name = [group_name]
             qs = qs.filter(
-              character__memberships__group__group_names=group_name).distinct()
+              character__memberships__group__group_names__in=group_name).distinct()

critical

There is an indentation error in these lines. Line 714 has 13 spaces of indentation, line 715 has 16 spaces, and line 716 has 12 spaces. In Python, inconsistent indentation will raise an IndentationError at runtime.

Additionally, to prevent empty queries when group_name contains empty or falsy values (e.g., ['']), we should filter them out before applying the queryset filter.

⬇️ Suggested change
-             if not isinstance(group_name, list):
-                group_name = [group_name]
-            qs = qs.filter(
-              character__memberships__group__group_names=group_name).distinct()
-              character__memberships__group__group_names__in=group_name).distinct()
+            if not isinstance(group_name, list):
+                group_name = [group_name]
+            group_name = [g for g in group_name if g]
+            if group_name:
+                qs = qs.filter(
+                    character__memberships__group__group_names__in=group_name
+                ).distinct()


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/721/review/4533329476@github.com>

jhunterjActual

unread,
Jun 19, 2026, 10:24:07 AM (9 days ago) Jun 19
to GrandComicsDatabase/gcd-django, Push

@jhunterjActual pushed 1 commit.

  • 025a1c5 incorporate Gemini Code Assist feedback


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/721/before/f92f0a3d9e6dcb48efaf32db6a7c155ce909e154/after/025a1c5247c1ff828ae6b412b2eecf513fd7b2a9@github.com>

JochenGCD

unread,
Jun 26, 2026, 2:54:09 PM (2 days ago) Jun 26
to GrandComicsDatabase/gcd-django, Subscribed

Merged #721 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/721/issue_event/27259629325@github.com>

Reply all
Reply to author
Forward
0 new messages