Import upload from the admin page always fails with 400 #45
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the v0.6.0 prod-image smoke run on
df180a7.What happens: Admin → Import/Export → Import Data, choose a JSON or CSV file, click Upload & Preview. The request comes back
400 Bad Requestand nothing is imported. Log:POST /admin/import-export/import→Sent 400 in 1ms.Why:
ImportExportController.create_import/2pattern-matches%{"job" => job_params}, but the upload form only has afileinput, so browsers never sendjobparams. Phoenix raisesPhoenix.ActionClauseError(400). The controller tests posted"job" => %{}by hand, which hid it. Also present in v0.5.1.Impact: importing from the UI doesn't work at all. Release blocker for v0.6.0 (import/export is a listed feature and #30 was meant to make it work).
Fix: accept the params without
job(default%{}), plus tests that post the form the way a browser does (file only, and no file).