nopaque/app/services/__init__.py

26 lines
505 B
Python
Raw Normal View History

2019-07-19 13:28:17 +02:00
from flask import Blueprint
2023-04-11 12:39:37 +02:00
from flask_login import login_required
import os
import yaml
2019-07-19 13:28:17 +02:00
2022-04-22 15:27:52 +02:00
services_file = \
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'services.yml')
with open(services_file, 'r') as f:
SERVICES = yaml.safe_load(f)
2021-02-19 13:00:52 +01:00
bp = Blueprint('services', __name__)
2023-04-11 11:46:33 +02:00
@bp.before_request
@login_required
def before_request():
'''
Ensures that the routes in this package can only be visited by users that
are logged in.
'''
pass
from . import routes # noqa