mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Update database
Correctly link user to their posts and groups Change the table names to Group, Post and User Remove unused Bans and Logs table, possibly will return later
This commit is contained in:
parent
9a21064dd5
commit
d36699bd1f
12 changed files with 185 additions and 270 deletions
|
@ -17,8 +17,8 @@ from werkzeug.exceptions import HTTPException
|
|||
from werkzeug.security import generate_password_hash
|
||||
|
||||
from gallery.extensions import db, migrate, login_manager, assets, compress, cache
|
||||
from gallery.models import Users
|
||||
from gallery.views import index, image, group, settings, profile
|
||||
from gallery.models import User
|
||||
from gallery import api
|
||||
from gallery import auth
|
||||
|
||||
|
@ -44,7 +44,7 @@ def create_app(): # pylint: disable=R0914
|
|||
with app.app_context():
|
||||
db.create_all()
|
||||
|
||||
register_user = Users(
|
||||
register_user = User(
|
||||
username=app.config["ADMIN_CONF"]["username"],
|
||||
email=app.config["ADMIN_CONF"]["email"],
|
||||
password=generate_password_hash('changeme!', method="sha256"),
|
||||
|
@ -81,7 +81,7 @@ def create_app(): # pylint: disable=R0914
|
|||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
return Users.query.filter_by(alt_id=user_id).first()
|
||||
return User.query.filter_by(alt_id=user_id).first()
|
||||
|
||||
@login_manager.unauthorized_handler
|
||||
def unauthorized():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue