server/general: fix pylint warnings
This commit is contained in:
		
							parent
							
								
									2429e95102
								
							
						
					
					
						commit
						a9338f6490
					
				| @ -2,7 +2,7 @@ import datetime | |||||||
| import sqlalchemy | import sqlalchemy | ||||||
| from szurubooru import config, db, errors | from szurubooru import config, db, errors | ||||||
| from szurubooru.func import ( | 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 = \ | EMPTY_PIXEL = \ | ||||||
|     b'\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00' \ |     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_width = None | ||||||
|         post.canvas_height = None |         post.canvas_height = None | ||||||
|     files.save(get_post_content_path(post), content) |     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: |     if not content: | ||||||
|         content = files.get(get_post_content_path(post)) |         content = files.get(get_post_content_path(post)) | ||||||
|         if delete: |         if do_delete: | ||||||
|             files.delete(get_post_thumbnail_backup_path(post)) |             files.delete(get_post_thumbnail_backup_path(post)) | ||||||
|     else: |     else: | ||||||
|         files.save(get_post_thumbnail_backup_path(post), content) |         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, |             'lastEditTime': lambda: tag.last_edit_time, | ||||||
|             'usages': lambda: tag.post_count, |             'usages': lambda: tag.post_count, | ||||||
|             'suggestions': lambda: [ |             'suggestions': lambda: [ | ||||||
|                 relation.names[0].name |                 relation.names[0].name \ | ||||||
|                     for relation in sort_tags(tag.suggestions)], |                     for relation in sort_tags(tag.suggestions)], | ||||||
|             'implications': lambda: [ |             'implications': lambda: [ | ||||||
|                 relation.names[0].name |                 relation.names[0].name \ | ||||||
|                     for relation in sort_tags(tag.implications)], |                     for relation in sort_tags(tag.implications)], | ||||||
|             'snapshots': lambda: snapshots.get_serialized_history(tag), |             'snapshots': lambda: snapshots.get_serialized_history(tag), | ||||||
|         }, |         }, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 rr-
						rr-