[Bug] Files chosen in pop-up (modal) forms are silently discarded
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- django, javascript
- Domain
- backend
Research direction
Start in templates/js/core.js at saveForm and check the modal form submission path for FormData; then inspect the add_own_qualification and update_own_qualification views to see whether they bind request.FILES. Verify that submitting a certificate file stores it and that the response still reports success.
Written by the indexing model from the issue text.
Description
Summary
templates/js/core.js saveForm submits every .js-submit-modal-form with data: form.serialize(). jQuery's serialize() never includes <input type="file">, so any file chosen in a modal form is dropped. The view saves the record and returns form_is_valid: true, so the user sees success but no file is stored.
We hit this with qualification certificates: add_own_qualification and update_own_qualification, field certificate_file.
Steps to reproduce
- Go to My Qualifications and add or edit a qualification.
- Choose a certificate file and save.
- The record saves, but it has no certificate, and no upload request carries the file.
Suggested fix
$.ajax({
url: form.attr("action"),
data: new FormData(form[0]),
processData: false,
contentType: false,
type: form.attr("method"),
dataType: "json",
// ...
});
The views must also bind request.FILES to the form (Form(request.POST, request.FILES, ...)), if they don't already.
- Dominant language
- HTML
- Stars
- 6
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from brainthee/CHAOTICA
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[Minor UI Bug] Client page shows account manager photos as squares overlapping the round borderOpen
Difficulty 1/5 Under an hour Newbie friendliness 94/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
All issues in brainthee/CHAOTICA
Similar issues
-
dropIndexes by key pattern panics on a shorter pattern and drops the wrong index on a longer oneOpen
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mega-yfue/ha-eufy-sdk-bridge#198 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
qte77/agentic-job-offer-to-application-kit#487 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#801 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days