diff options
| author | Shyam Sunder | 2020-03-06 10:24:46 -0500 |
|---|---|---|
| committer | Shyam Sunder | 2020-03-06 10:29:03 -0500 |
| commit | f1a09c21d429f74bffa4d6a5c8ce9f12d1b3f528 (patch) | |
| tree | 5efea3358b38f6b75141369d1b8b15243d750767 /server/szurubooru | |
| parent | 72e104b14570db158e2ee40ae7ebac473cf3bbbe (diff) | |
server/func/tag_categories: fixed deprecated SA function call
Diffstat (limited to 'server/szurubooru')
| -rw-r--r-- | server/szurubooru/func/tag_categories.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/szurubooru/func/tag_categories.py b/server/szurubooru/func/tag_categories.py index b6e0257..ab0fc32 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 |