From 4ef9a7b58cdaab95d96723379017c4b1251ba334 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 1 Sep 2022 21:00:08 +0200 Subject: [PATCH] fix occasional 500 errors on WPD --- files/routes/users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/users.py b/files/routes/users.py index 8eeb982aa..abc9a9342 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -927,6 +927,7 @@ def u_username(username, v=None): abort(404) if v and v.id not in (u.id, DAD_ID) and u.viewers_recorded: + g.db.flush() view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none() if view: view.last_view_utc = int(time.time())