server/general: fix pylint warnings
This commit is contained in:
parent
2429e95102
commit
a9338f6490
2 changed files with 6 additions and 6 deletions
|
@ -2,7 +2,7 @@ import datetime
|
|||
import sqlalchemy
|
||||
from szurubooru import config, db, errors
|
||||
from szurubooru.func import (
|
||||
users, snapshots, scores, comments, tags, tag_categories, util, mime, images, files)
|
||||
users, snapshots, scores, comments, tags, util, mime, images, files)
|
||||
|
||||
EMPTY_PIXEL = \
|
||||
b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \
|
||||
|
@ -223,12 +223,12 @@ def update_post_content(post, content):
|
|||
post.canvas_width = None
|
||||
post.canvas_height = None
|
||||
files.save(get_post_content_path(post), content)
|
||||
update_post_thumbnail(post, content=None, delete=False)
|
||||
update_post_thumbnail(post, content=None, do_delete=False)
|
||||
|
||||
def update_post_thumbnail(post, content=None, delete=True):
|
||||
def update_post_thumbnail(post, content=None, do_delete=True):
|
||||
if not content:
|
||||
content = files.get(get_post_content_path(post))
|
||||
if delete:
|
||||
if do_delete:
|
||||
files.delete(get_post_thumbnail_backup_path(post))
|
||||
else:
|
||||
files.save(get_post_thumbnail_backup_path(post), content)
|
||||
|
|
|
@ -58,10 +58,10 @@ def serialize_tag(tag, options=None):
|
|||
'lastEditTime': lambda: tag.last_edit_time,
|
||||
'usages': lambda: tag.post_count,
|
||||
'suggestions': lambda: [
|
||||
relation.names[0].name
|
||||
relation.names[0].name \
|
||||
for relation in sort_tags(tag.suggestions)],
|
||||
'implications': lambda: [
|
||||
relation.names[0].name
|
||||
relation.names[0].name \
|
||||
for relation in sort_tags(tag.implications)],
|
||||
'snapshots': lambda: snapshots.get_serialized_history(tag),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue