-
Notifications
You must be signed in to change notification settings - Fork 172
Simple fix for the CfP proposal progress issue #1551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 11 commits
3df7224
8ea953d
420f0e7
a9d6497
39f554f
8f0d4f5
24869d4
949fc09
4cb8aa5
6df7d43
1cc125e
97be255
f0274a4
c335825
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -49,6 +49,16 @@ <h2>{% block submission_step_title %}{{ title|default:'' }}{% endblock submissio | |||||
| </div> | ||||||
| {% block submission_step_text %}<p>{{ text|rich_text }}</p>{% endblock %} | ||||||
| {% block inner %} | ||||||
| {% if uploaded_files %} | ||||||
| <div class="alert alert-info mb-3"> | ||||||
| <i class="fa fa-info-circle"></i> {% translate "Previously uploaded files:" %} | ||||||
| <ul class="mb-0 mt-1"> | ||||||
| {% for field_name, filename in uploaded_files.items %} | ||||||
| <li><strong>{{ field_name|default:'' }}</strong>: {{ filename }} {% translate "(will be preserved if you don't upload a new file)" %}</li> | ||||||
|
||||||
| <li><strong>{{ field_name|default:'' }}</strong>: {{ filename }} {% translate "(will be preserved if you don't upload a new file)" %}</li> | |
| <li><strong>{{ field_name|default:''|capfirst }}</strong>: {{ filename }} {% translate "(will be preserved if you don't upload a new file)" %}</li> |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -71,6 +71,10 @@ def dispatch(self, request, *args, **kwargs): | |||||||||
| or step.identifier == 'user' | ||||||||||
| ], | ||||||||||
| ) | ||||||||||
| if request.method == 'POST' and request.POST.get('action') == 'back': | ||||||||||
| # When clicking Back, the step's POST handler has already saved the data | ||||||||||
| # Now redirect to the previous step | ||||||||||
|
Comment on lines
+75
to
+76
|
||||||||||
| # When clicking Back, the step's POST handler has already saved the data | |
| # Now redirect to the previous step | |
| # When clicking Back, the step's POST handler has already processed the data | |
| # (and, if valid, saved it). Now redirect to the previous step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Merging
session_filesintoMultiValueDictcan break multi-file fields and value types.The merge assumes
session_files.items()returns a single file per field, butget_files()likely returns aMultiValueDict-like object or lists for multi-file fields. Assigning withfiles[field] = file_objcausesMultiValueDict.__setitem__to wrap values in a list; iffile_objis already a list, you get nested lists. And ifsession_filesis aMultiValueDict, iterating over.items()drops all but the last file per field.To preserve multi-file semantics, build
filesusingsetlist/lists()instead of plain item assignment, e.g.:This preserves existing multi-file values and avoids nested lists when there’s no new upload for a field.