mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-07 22:08:56 -06:00
continued hidden refactor
This commit is contained in:
@@ -16,5 +16,5 @@ db = SQLAlchemy(app)
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
from app import models
|
||||
from app import routes, simple_routes, hidden, dashboard, custom
|
||||
from app import routes, simple_routes, hidden, dashboard, ftbhot, custom
|
||||
app.jinja_env.globals.update(get_hidden=routes.get_hidden)
|
||||
@@ -1,6 +1,22 @@
|
||||
from app import app, db, login
|
||||
from app.custom import require_role
|
||||
from flask_login import current_user, login_user, logout_user, login_required
|
||||
from flask import request
|
||||
|
||||
# The only implementation I could get to work
|
||||
def validate_id(id):
|
||||
id = str(id).strip()
|
||||
val = str(app.config['HIDDEN_NUMBER']).strip()
|
||||
return id == val
|
||||
|
||||
# Parses strings to test for "boolean-ness"
|
||||
def boolparse(string, default=False):
|
||||
trues = ['true', '1']
|
||||
if string is None:
|
||||
return default
|
||||
elif string.lower() in trues:
|
||||
return True
|
||||
return False
|
||||
|
||||
@app.route('/hidden<id>/')
|
||||
@login_required
|
||||
|
||||
@@ -171,12 +171,6 @@ def logout():
|
||||
logout_user()
|
||||
return redirect(url_for('index'))
|
||||
|
||||
# The only implementation I could get to work
|
||||
def validate_id(id):
|
||||
id = str(id).strip()
|
||||
val = str(app.config['HIDDEN_NUMBER']).strip()
|
||||
return id == val
|
||||
|
||||
def get_hidden():
|
||||
return "/hidden{}/".format(app.config['HIDDEN_NUMBER'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user