You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
510 B
20 lines
510 B
from flask import current_app, session
|
|
from suchwow.models import Moderator
|
|
|
|
|
|
def allowed_file(filename):
|
|
return "." in filename and \
|
|
filename.rsplit(".", 1)[1].lower() in current_app.config["ALLOWED_EXTENSIONS"]
|
|
|
|
def is_moderator(username):
|
|
m = Moderator.filter(username=username)
|
|
if m:
|
|
return True
|
|
else:
|
|
return False
|
|
|
|
def get_session_user():
|
|
if "auth" not in session or not session["auth"]:
|
|
return None
|
|
return session["auth"]["preferred_username"]
|