1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 14:10:00 +00:00

Fix upload api handler: default to '' to conform better to WTForm

This commit is contained in:
TheAMM 2017-05-21 12:41:34 +03:00
parent 5408f3e7c4
commit 740be1a40a

View file

@ -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)