From bf7de473b79a8d321237c0968e0b5b9dd4df816f Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 23 Dec 2024 13:19:51 +0000 Subject: [PATCH] prevent account route throwing unsupported media type --- portality/view/account.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/portality/view/account.py b/portality/view/account.py index 3b9681c40..b6ce1d486 100644 --- a/portality/view/account.py +++ b/portality/view/account.py @@ -85,7 +85,13 @@ def username(username): if not form.validate(): return render_template(template, account=acc, form=form) - newdata = request.json if request.json else request.values + newdata = request.values + try: + newdata = request.json + except: + pass + + # newdata = request.json if request.json else request.values if request.values.get('submit', False) == 'Generate a new API Key': acc.generate_api_key()