mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 19:29:58 +00:00
Cleanip init.py, utils.py and decorators.py
This commit is contained in:
@@ -4,6 +4,9 @@ from functools import wraps
|
||||
from flask import redirect, url_for
|
||||
|
||||
|
||||
# Decorator that checks if the current user is logged in and an admin
|
||||
# Could be shortened by adding the login_required decorator
|
||||
# and removing the logic here
|
||||
def admin_required(f: Callable[..., Any]) -> Callable[..., Any]:
|
||||
@wraps(f)
|
||||
def decorated_function(*args: ..., **kwargs: ...):
|
||||
|
||||
Reference in New Issue
Block a user