mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-06 17:16:20 -06:00
Merge remote-tracking branch 'origin/bio'
This commit is contained in:
12
auth.py
12
auth.py
@@ -1,5 +1,5 @@
|
|||||||
from flask import Blueprint, flash, redirect, request, url_for
|
from flask import Blueprint, flash, redirect, request, url_for
|
||||||
from flask_login import login_required, login_user, logout_user
|
from flask_login import login_required, login_user, logout_user, current_user
|
||||||
from werkzeug.security import check_password_hash, generate_password_hash
|
from werkzeug.security import check_password_hash, generate_password_hash
|
||||||
|
|
||||||
from .models import User
|
from .models import User
|
||||||
@@ -7,12 +7,12 @@ from .create_app import db
|
|||||||
|
|
||||||
blueprint = Blueprint('auth', __name__)
|
blueprint = Blueprint('auth', __name__)
|
||||||
|
|
||||||
'''
|
|
||||||
FIXME this will have to be revisited later with added funcitonality,
|
|
||||||
as right now `login`, `signup`, and `logout` only return text
|
|
||||||
|
|
||||||
There will also be routes for handling POST requests from login and signup
|
@blueprint.route('/user/<username>', methods=['POST'])
|
||||||
'''
|
def bio_post():
|
||||||
|
bio = request.form.get('bio')
|
||||||
|
setattr(current_user, 'bio', bio)
|
||||||
|
setattr(current_user, 'has_bio', True)
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/login', methods=['POST'])
|
@blueprint.route('/login', methods=['POST'])
|
||||||
|
|||||||
@@ -7,3 +7,7 @@ class User(UserMixin, db.Model):
|
|||||||
username = db.Column(db.String(100), unique=True)
|
username = db.Column(db.String(100), unique=True)
|
||||||
password = db.Column(db.String(100))
|
password = db.Column(db.String(100))
|
||||||
name = db.Column(db.String(1000))
|
name = db.Column(db.String(1000))
|
||||||
|
has_bio = db.Column(db.Boolean, default=False)
|
||||||
|
bio = db.Column(db.String(5000), nullable=True)
|
||||||
|
|
||||||
|
# day registered, last online, register date, last ip
|
||||||
|
|||||||
Reference in New Issue
Block a user