first quick pass of user menu in navbar which shows simple read only prefs content, and a logout option that works

This commit is contained in:
2022-01-16 11:37:49 +11:00
parent 136525a73c
commit 684cc27df9
6 changed files with 71 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
from settings import Settings, SettingsRBPath, SettingsIPath, SettingsSPath
from flask_login import current_user
from flask import request, render_template, redirect, url_for
from flask_login import login_required, current_user
from main import db, app, ma
from shared import PA
@@ -145,3 +146,13 @@ class Options(PA):
db.session.add(pref)
db.session.commit()
################################################################################
# /prefs -> GET only -> prints out list of all prefs (simple for now)
################################################################################
@app.route("/prefs", methods=["GET"])
@login_required
def prefs():
prefs = PA_PREF.query.filter( PA_PREF.pa_user_dn==current_user.dn ).all()
return render_template("prefs.html", prefs=prefs )