mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Daddy PyLint
This commit is contained in:
parent
4627498b8d
commit
a49d6dc321
5 changed files with 10 additions and 10 deletions
|
@ -28,7 +28,7 @@ def login():
|
||||||
|
|
||||||
username = request.form['username'].strip()
|
username = request.form['username'].strip()
|
||||||
password = request.form['password'].strip()
|
password = request.form['password'].strip()
|
||||||
remember = True if request.form.get('remember') else False
|
remember = bool(request.form['remember'])
|
||||||
|
|
||||||
user = db_session.query(db.Users).filter_by(username=username).first()
|
user = db_session.query(db.Users).filter_by(username=username).first()
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ OnlyLegs - Database models and functions for SQLAlchemy
|
||||||
"""
|
"""
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
import os
|
import os
|
||||||
import platformdirs
|
|
||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
|
import platformdirs
|
||||||
|
|
||||||
from sqlalchemy import create_engine, Column, Integer, String, DateTime, ForeignKey, PickleType
|
from sqlalchemy import create_engine, Column, Integer, String, DateTime, ForeignKey, PickleType
|
||||||
from sqlalchemy.orm import declarative_base, relationship
|
from sqlalchemy.orm import declarative_base, relationship
|
||||||
|
|
|
@ -83,20 +83,20 @@ def profile():
|
||||||
Profile overview, shows all profiles on the onlylegs gallery
|
Profile overview, shows all profiles on the onlylegs gallery
|
||||||
"""
|
"""
|
||||||
user_id = request.args.get('id', default=None, type=int)
|
user_id = request.args.get('id', default=None, type=int)
|
||||||
|
|
||||||
# If there is no userID set, check if the user is logged in and display their profile
|
# If there is no userID set, check if the user is logged in and display their profile
|
||||||
if not user_id:
|
if not user_id:
|
||||||
if current_user.is_authenticated:
|
if current_user.is_authenticated:
|
||||||
user_id = current_user.id
|
user_id = current_user.id
|
||||||
else:
|
else:
|
||||||
abort(404, 'You must be logged in to view your own profile!')
|
abort(404, 'You must be logged in to view your own profile!')
|
||||||
|
|
||||||
# Get the user's data
|
# Get the user's data
|
||||||
user = db_session.query(db.Users).filter(db.Users.id == user_id).first()
|
user = db_session.query(db.Users).filter(db.Users.id == user_id).first()
|
||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
abort(404, 'User not found :c')
|
abort(404, 'User not found :c')
|
||||||
|
|
||||||
images = db_session.query(db.Posts).filter(db.Posts.author_id == user_id).all()
|
images = db_session.query(db.Posts).filter(db.Posts.author_id == user_id).all()
|
||||||
|
|
||||||
return render_template('profile.html', user=user, images=images)
|
return render_template('profile.html', user=user, images=images)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
OnlyLegs - Settings page
|
OnlyLegs - Settings page
|
||||||
"""
|
"""
|
||||||
from flask import Blueprint, render_template
|
from flask import Blueprint, render_template
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required
|
||||||
|
|
||||||
blueprint = Blueprint('settings', __name__, url_prefix='/settings')
|
blueprint = Blueprint('settings', __name__, url_prefix='/settings')
|
||||||
|
|
||||||
|
|
4
run.py
4
run.py
|
@ -28,10 +28,10 @@ if DEBUG:
|
||||||
else:
|
else:
|
||||||
from setup.runner import OnlyLegs # pylint: disable=C0412
|
from setup.runner import OnlyLegs # pylint: disable=C0412
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# Stop Gunicorn from reading the command line arguments as it causes errors
|
# Stop Gunicorn from reading the command line arguments as it causes errors
|
||||||
sys.argv = [sys.argv[0]]
|
sys.argv = [sys.argv[0]]
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
'bind': f'{ADDRESS}:{PORT}',
|
'bind': f'{ADDRESS}:{PORT}',
|
||||||
'workers': WORKERS,
|
'workers': WORKERS,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue