rpiwebapp-public/admin/admin.py
Matthew Welch 1fb4a869b0 Added user data and Google OAuth
Added initial implementation of user data for tv shows and movies as well as OAuth for Google sign in.
2020-03-19 19:25:44 -07:00

14 lines
453 B
Python

from flask import Blueprint, flash, redirect, url_for, render_template
from flask_login import login_required, current_user
Admin = Blueprint("admin", __name__, template_folder="templates")
@Admin.route("/admin")
@login_required
def index():
if not current_user.is_admin:
flash("you must be an admin to access this page, login with an admin account.")
return redirect(url_for("login"))
return render_template("admin/index.html", title="Admin")