mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Rename routes to gallery
Move methods to api.py Remove old db manager as its unused Remove old db tables as theres a new schema file Rename onlylegsSass to sassy, unused for now Update example.env to reflect new layout
This commit is contained in:
parent
a499e6c840
commit
e395139656
13 changed files with 146 additions and 326 deletions
|
@ -5,10 +5,10 @@ from flask import (
|
|||
from werkzeug.security import check_password_hash, generate_password_hash
|
||||
from gallery.db import get_db
|
||||
|
||||
bp = Blueprint('auth', __name__, url_prefix='/auth')
|
||||
blueprint = Blueprint('auth', __name__, url_prefix='/auth')
|
||||
|
||||
|
||||
@bp.before_app_request
|
||||
@blueprint.before_app_request
|
||||
def load_logged_in_user():
|
||||
user_id = session.get('user_id')
|
||||
|
||||
|
@ -20,7 +20,7 @@ def load_logged_in_user():
|
|||
).fetchone()
|
||||
|
||||
|
||||
@bp.route('/register', methods=('GET', 'POST'))
|
||||
@blueprint.route('/register', methods=('GET', 'POST'))
|
||||
def register():
|
||||
if request.method == 'POST':
|
||||
username = request.form['username']
|
||||
|
@ -50,7 +50,7 @@ def register():
|
|||
return render_template('auth/register.html')
|
||||
|
||||
|
||||
@bp.route('/login', methods=('GET', 'POST'))
|
||||
@blueprint.route('/login', methods=('GET', 'POST'))
|
||||
def login():
|
||||
if request.method == 'POST':
|
||||
username = request.form['username']
|
||||
|
@ -76,7 +76,7 @@ def login():
|
|||
return render_template('auth/login.html')
|
||||
|
||||
|
||||
@bp.route('/logout')
|
||||
@blueprint.route('/logout')
|
||||
def logout():
|
||||
session.clear()
|
||||
return redirect(url_for('index'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue