From 73a8542220c983e1c7a2f4929ae0a18a3dbf4a8b Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 22 Aug 2016 20:07:39 +0200 Subject: [PATCH] server/posts: make anon snapshots for anon uploads --- server/szurubooru/api/post_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index d60cc3df..34e007cc 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -46,7 +46,7 @@ def create_post(ctx, _params=None): auth.verify_privilege(ctx.user, 'tags:create') db.session.flush() for tag in new_tags: - snapshots.create(tag, ctx.user) + snapshots.create(tag, None if anonymous else ctx.user) posts.update_post_safety(post, safety) posts.update_post_source(post, source) posts.update_post_relations(post, relations) @@ -55,7 +55,7 @@ def create_post(ctx, _params=None): if ctx.has_file('thumbnail'): posts.update_post_thumbnail(post, ctx.get_file('thumbnail')) ctx.session.add(post) - snapshots.create(post, ctx.user) + snapshots.create(post, None if anonymous else ctx.user) ctx.session.commit() tags.export_to_json() return _serialize_post(ctx, post)