From f1a09c21d429f74bffa4d6a5c8ce9f12d1b3f528 Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Fri, 6 Mar 2020 10:24:46 -0500 Subject: [PATCH] server/func/tag_categories: fixed deprecated SA function call --- server/szurubooru/func/tag_categories.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/szurubooru/func/tag_categories.py b/server/szurubooru/func/tag_categories.py index b6e0257f..ab0fc321 100644 --- a/server/szurubooru/func/tag_categories.py +++ b/server/szurubooru/func/tag_categories.py @@ -119,7 +119,7 @@ def try_get_category_by_name( .query(model.TagCategory) .filter(sa.func.lower(model.TagCategory.name) == name.lower())) if lock: - query = query.with_lockmode('update') + query = query.with_for_update() return query.one_or_none() @@ -146,7 +146,7 @@ def try_get_default_category( .query(model.TagCategory) .filter(model.TagCategory.default)) if lock: - query = query.with_lockmode('update') + query = query.with_for_update() category = query.first() # if for some reason (e.g. as a result of migration) there's no default # category, get the first record available. @@ -156,7 +156,7 @@ def try_get_default_category( .query(model.TagCategory) .order_by(model.TagCategory.tag_category_id.asc())) if lock: - query = query.with_lockmode('update') + query = query.with_for_update() category = query.first() return category