From 5f29112390da464a7ab5aceb7d3a37f57e83c186 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Tue, 29 Oct 2019 09:51:47 +0100 Subject: [PATCH] Fix some things --- app/main/events.py | 2 +- app/templates/admin/admin_user_page.html.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/events.py b/app/main/events.py index 2e84f61a..960db923 100644 --- a/app/main/events.py +++ b/app/main/events.py @@ -69,7 +69,7 @@ def background_task(app, user_id, session_id, foreign=False): ' > where '*' is either 'corpora' or 'jobs' ''' with app.app_context(): - user = db.session.query(User).filter_by(id=user_id).first() + user = db.session.query(User).get_or_404(user_id) ''' Get current values from the database. ''' corpora = user.corpora_as_dict() jobs = user.jobs_as_dict() diff --git a/app/templates/admin/admin_user_page.html.j2 b/app/templates/admin/admin_user_page.html.j2 index c37f08f0..56b98599 100644 --- a/app/templates/admin/admin_user_page.html.j2 +++ b/app/templates/admin/admin_user_page.html.j2 @@ -41,8 +41,8 @@
- User Jobs
+ User Jobs
@@ -73,8 +73,8 @@
- User Corpora
+ User Corpora