This change affects the Online Indexer Copy Sequence workflow.
Start from an issue changeset edit page, then select Copy Sequence.
The change is implemented in the session-based object selection screen,
select_object, used to select stories from the data cache.
Clear Objects and multiple-object removal actions.The implementation reuses the existing session-based selection flow and wraps the multiple-copy operation in a Django transaction.
https://github.com/GrandComicsDatabase/gcd-django/pull/758
(5 files)
—
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.![]()
@gemini-code-assist[bot] commented on this pull request.
This pull request introduces support for copying multiple cached stories or covers at once into an issue revision, including UI updates for multiple selection, confirmation templates, and comprehensive unit tests. Feedback on the changes suggests correcting the indentation of the new _parse_selection function to follow PEP 8, improving the robustness of checkbox boolean checks by verifying key presence in request.POST instead of using .get(), and handling cases where multiple_selection might be explicitly set to None in session data.
> +def _parse_selection(request, choice):
+ try:
+ object_type, selected_id = choice.split('_', 1)
+ except ValueError:
+ return None, None, render_error(
+ request,
+ 'The selected object is invalid. Please return and try again.',
+ redirect=False)
+ if object_type not in ('publisher', 'series', 'issue', 'story', 'cover') \
+ or not selected_id.isdecimal():
+ return None, None, render_error(
+ request,
+ 'The selected object is invalid. Please return and try again.',
+ redirect=False)
+ return object_type, selected_id, None
The indentation of the _parse_selection function uses 8 spaces instead of the standard 4 spaces. According to PEP 8, 4 spaces per indentation level should be used to maintain consistency and readability across the codebase.
⬇️ Suggested change-def _parse_selection(request, choice):
- try:
- object_type, selected_id = choice.split('_', 1)
- except ValueError:
- return None, None, render_error(
- request,
- 'The selected object is invalid. Please return and try again.',
- redirect=False)
- if object_type not in ('publisher', 'series', 'issue', 'story', 'cover') \
- or not selected_id.isdecimal():
- return None, None, render_error(
- request,
- 'The selected object is invalid. Please return and try again.',
- redirect=False)
- return object_type, selected_id, None
+def _parse_selection(request, choice):
+ try:
+ object_type, selected_id = choice.split('_', 1)
+ except ValueError:
+ return None, None, render_error(
+ request,
+ 'The selected object is invalid. Please return and try again.',
+ redirect=False)
+ if (object_type not in ('publisher', 'series', 'issue', 'story', 'cover')
+ or not selected_id.isdecimal()):
+ return None, None, render_error(
+ request,
+ 'The selected object is invalid. Please return and try again.',
+ redirect=False)
+ return object_type, selected_id, None
References
In apps/oi/views.py:
> + copy_credit_info = request.POST.get('copy_credit_info', False)
+ copy_characters = request.POST.get('copy_characters', False)
In Django, checkboxes that are unchecked are not submitted in the POST request, while checked checkboxes submit their value attribute (or 'on'). Using request.POST.get('copy_credit_info', False) can be problematic if a string like 'False' is sent, as any non-empty string is truthy in Python. It is more idiomatic and robust to check for the presence of the key in request.POST.
⬇️ Suggested change- copy_credit_info = request.POST.get('copy_credit_info', False)
- copy_characters = request.POST.get('copy_characters', False)
+ copy_credit_info = 'copy_credit_info' in request.POST
+ copy_characters = 'copy_characters' in request.POST
> + if not data.get('multiple_selection',
+ data.get('return') == '_selected_copy_sequence'):
Using data.get('multiple_selection', default) can lead to unexpected behavior if multiple_selection is explicitly set to None in the session data, as the default fallback will be ignored and None (falsy) will be returned. It is safer to explicitly check if the value is None and fall back to the default, matching the logic used in the GET block on lines 352-354.
⬇️ Suggested change- if not data.get('multiple_selection',
- data.get('return') == '_selected_copy_sequence'):
+ can_copy_multiple = data.get('multiple_selection')
+ if can_copy_multiple is None:
+ can_copy_multiple = data.get('return') == '_selected_copy_sequence'
+ if not can_copy_multiple:
—
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.![]()
@ProfNardi pushed 1 commit.
—
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.![]()
—
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.![]()
This PR is superseded by #767.
The changes have been incorporated into the newer PR, which should be reviewed and merged instead.
—
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.![]()