mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Daddy PyLint
This commit is contained in:
parent
4627498b8d
commit
a49d6dc321
5 changed files with 10 additions and 10 deletions
|
@ -83,20 +83,20 @@ def profile():
|
|||
Profile overview, shows all profiles on the onlylegs gallery
|
||||
"""
|
||||
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 not user_id:
|
||||
if current_user.is_authenticated:
|
||||
user_id = current_user.id
|
||||
else:
|
||||
abort(404, 'You must be logged in to view your own profile!')
|
||||
|
||||
|
||||
# Get the user's data
|
||||
user = db_session.query(db.Users).filter(db.Users.id == user_id).first()
|
||||
|
||||
|
||||
if not user:
|
||||
abort(404, 'User not found :c')
|
||||
|
||||
|
||||
images = db_session.query(db.Posts).filter(db.Posts.author_id == user_id).all()
|
||||
|
||||
|
||||
return render_template('profile.html', user=user, images=images)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
OnlyLegs - Settings page
|
||||
"""
|
||||
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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue