From cb3175d1491c22681577f1a64ada3b8df54f33b2 Mon Sep 17 00:00:00 2001 From: nsde Date: Sat, 23 Sep 2023 17:08:19 +0200 Subject: [PATCH] Small fixes --- .gitignore | 2 +- web/finances.py | 6 +++++- web/templates/account.html | 3 ++- web/templates/index.html | 8 ++++---- web/templates/legal/imprint.html | 1 - 5 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 web/templates/legal/imprint.html diff --git a/.gitignore b/.gitignore index 444c29d..d826ffe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ !.gitkeep - +imprint.html data/ # Byte-compiled / optimized / DLL files diff --git a/web/finances.py b/web/finances.py index 3078e36..a0d5958 100755 --- a/web/finances.py +++ b/web/finances.py @@ -22,7 +22,11 @@ def get_finances(): def register(app): @app.route('/finances') def finances_view(): - data = get_finances() + try: + data = get_finances() + except Exception: + return flask.Response('Error fetching finances from database. This might be cause the data is still being processed. Sorry.', status=500) + finances = { 'donations_total': round(sum([i['amount_usd'] for i in data['donations']])), 'donations_num': len(data['donations']), diff --git a/web/templates/account.html b/web/templates/account.html index 7d688a7..d7f4dee 100644 --- a/web/templates/account.html +++ b/web/templates/account.html @@ -13,7 +13,8 @@ API credits: {{ user.credits or 0 }}
Secret API key (click to reveal):
- {{ user.api_key or '-' }} + + {{ "API key not shown for security reasons" or '-' }}
(Click again to copy)