mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 14:30:01 +00:00
Fix upload api handler: default to '' to conform better to WTForm
This commit is contained in:
parent
5408f3e7c4
commit
740be1a40a
|
@ -163,7 +163,7 @@ def v2_api_upload():
|
|||
# Map api keys to upload form fields
|
||||
for key in UPLOAD_API_KEYS:
|
||||
mapped_key = UPLOAD_API_FORM_KEYMAP_REVERSE.get(key, key)
|
||||
mapped_dict[mapped_key] = request_data.get(key)
|
||||
mapped_dict[mapped_key] = request_data.get(key) or ''
|
||||
|
||||
# Flask-WTF (very helpfully!!) automatically grabs the request form, so force a None formdata
|
||||
upload_form = forms.UploadForm(None, data=mapped_dict)
|
||||
|
|
Loading…
Reference in a new issue