mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-01-14 02:25:21 +00:00
Pylinty
This commit is contained in:
parent
e69ac64855
commit
e3c25a5241
|
@ -1,7 +1,6 @@
|
|||
"""
|
||||
Onlylegs - API endpoints
|
||||
"""
|
||||
from uuid import uuid4
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
|
@ -31,7 +30,7 @@ def account_picture(user_id):
|
|||
# If no image is uploaded, return 404 error
|
||||
if not file:
|
||||
return jsonify({"error": "No file uploaded"}), 400
|
||||
elif user.id != current_user.id:
|
||||
if user.id != current_user.id:
|
||||
return jsonify({"error": "You are not allowed to do this, go away"}), 403
|
||||
|
||||
# Get file extension, generate random name and set file path
|
||||
|
@ -84,7 +83,7 @@ def account_username(user_id):
|
|||
# Validate the form
|
||||
if not new_name or not username_regex.match(new_name):
|
||||
return jsonify({"error": "Username is invalid"}), 400
|
||||
elif user.id != current_user.id:
|
||||
if user.id != current_user.id:
|
||||
return jsonify({"error": "You are not allowed to do this, go away"}), 403
|
||||
|
||||
# Save to database
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
Onlylegs - API endpoints
|
||||
Media upload and retrieval
|
||||
"""
|
||||
import os
|
||||
from uuid import uuid4
|
||||
import os
|
||||
import pathlib
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
"""
|
||||
Tools for generating images and thumbnails
|
||||
"""
|
||||
|
||||
import os
|
||||
from PIL import Image, ImageOps
|
||||
from onlylegs.config import MEDIA_FOLDER, CACHE_FOLDER
|
||||
from werkzeug.utils import secure_filename
|
||||
from onlylegs.config import MEDIA_FOLDER, CACHE_FOLDER
|
||||
|
||||
|
||||
def generate_thumbnail(file_path, resolution, ext=None):
|
||||
|
|
Loading…
Reference in a new issue