From 7066fb258e6ad5ade296ecc75bb7b5763c5d4301 Mon Sep 17 00:00:00 2001 From: TheAMM Date: Mon, 22 May 2017 16:54:02 +0300 Subject: [PATCH] Wait, that was no dict at all! Fix v1 api default --- nyaa/api_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nyaa/api_handler.py b/nyaa/api_handler.py index b415242..ade1e2b 100644 --- a/nyaa/api_handler.py +++ b/nyaa/api_handler.py @@ -93,7 +93,8 @@ def api_upload(upload_request, user): else: form_info_as_dict.append((k, v)) # Hack for while v1 is still being used: default trusted to true - form_info_as_dict.setdefault('is_trusted', True) + if not [x for x in form_info_as_dict if x[0] == 'is_trusted']: + form_info_as_dict.append(('is_trusted', True)) form_info = ImmutableMultiDict(form_info_as_dict) except Exception as e: return flask.make_response(flask.jsonify(