diff options
| author | Shyam Sunder | 2020-03-21 18:25:54 -0400 |
|---|---|---|
| committer | Shyam Sunder | 2020-03-21 18:25:54 -0400 |
| commit | 65202189e10027770f6737c46ab0b87884150b5e (patch) | |
| tree | 530e80b63deaaa49844b51b4aca6dc4b62476928 /server/szurubooru/api/post_api.py | |
| parent | c60ec22b92d9273183d076e630360ee63f6c0a1c (diff) | |
server/posts/upload: edit default flag behavior
The 'loop' flag will be auto-selected by default on video posts if
the flags parameter is undefined when creating a new post.
Diffstat (limited to 'server/szurubooru/api/post_api.py')
| -rw-r--r-- | server/szurubooru/api/post_api.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index 8409484..09aea90 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -54,7 +54,9 @@ def create_post( source = ctx.get_param_as_string('contentUrl', default='') relations = ctx.get_param_as_int_list('relations', default=[]) notes = ctx.get_param_as_list('notes', default=[]) - flags = ctx.get_param_as_string_list('flags', default=[]) + flags = ctx.get_param_as_string_list( + 'flags', + default=posts.get_default_flags(content)) post, new_tags = posts.create_post( content, tag_names, None if anonymous else ctx.user) @@ -65,7 +67,6 @@ def create_post( posts.update_post_relations(post, relations) posts.update_post_notes(post, notes) posts.update_post_flags(post, flags) - posts.test_sound(post, content) if ctx.has_file('thumbnail'): posts.update_post_thumbnail(post, ctx.get_file('thumbnail')) ctx.session.add(post) |