diff options
| author | stilbruch <stilbruch@protonail.com> | 2022-04-04 17:44:12 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonail.com> | 2022-04-04 17:44:12 -0500 |
| commit | a981d059304e2cab36cf694b09334245ce855d12 (patch) | |
| tree | 325538d6785da614cef68110defb3eaa60f48e11 | |
| parent | 5d74e9e1bb30e65dbd4d0528f7140b7813965841 (diff) | |
| download | Strengthy-a981d059304e2cab36cf694b09334245ce855d12.tar.xz Strengthy-a981d059304e2cab36cf694b09334245ce855d12.zip | |
Improve "login_required"
| -rw-r--r-- | app/app.py | 1 | ||||
| -rw-r--r-- | app/routes.py | 1 | ||||
| -rw-r--r-- | app/templates/base/form.html | 10 |
3 files changed, 9 insertions, 3 deletions
@@ -12,6 +12,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # Setup flask-login login_manager = LoginManager(app) login_manager.init_app(app) +login_manager.login_view = "/login" # Setup SQLAlchemy # https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/#a-minimal-application diff --git a/app/routes.py b/app/routes.py index ce47d83..336218c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -60,6 +60,7 @@ def register(): return render_template('user/register.html', form=form) @app.route("/workout/create", methods=['GET', 'POST']) +@login_required def createWorkout(): form = RegisterForm() return render_template('workout/create.html', form=form) diff --git a/app/templates/base/form.html b/app/templates/base/form.html index 440ea0e..8423a0c 100644 --- a/app/templates/base/form.html +++ b/app/templates/base/form.html @@ -13,9 +13,13 @@ {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} - <div class="notification is-{{ category }}"> - {{ message }} - </div> + {% if category == "message" %} + <div class="notification is-info"> + {% else %} + <div class="notification is-{{ category }}"> + {% endif %} + {{ message }} + </div> {% endfor %} {% endif %} {% endwith %} |
