Source code for schedula.utils.form.server.gdpr

# coding=utf-8
# -*- coding: UTF-8 -*-
#
# Copyright 2015-2025, Vincenzo Arcidiacono;
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl

"""
It provides functions to build the credit application services.
"""
import uuid
import datetime
from .extensions import db
from flask_security.utils import view_commit
from flask_security import current_user as cu
from sqlalchemy import Column, String, DateTime, JSON
from flask import request, jsonify, Blueprint, after_this_request, current_app

bp = Blueprint('schedula_gdpr', __name__)














[docs] @bp.route('/files/terms-conditions', methods=['GET']) @bp.route('/files/cookies-policy', methods=['GET']) def gdpr_files(): path = request.path.split('/')[-1] return current_app.send_static_file(f'gdpr/{path}.pdf')
[docs] class GDPR:
[docs] def __init__(self, app, sitemap, *args, **kwargs): if app is not None: self.init_app(app, sitemap, *args, **kwargs)
[docs] def init_app(self, app, sitemap, *args, **kwargs): app.extensions = getattr(app, 'extensions', {}) app.register_blueprint(bp, url_prefix='/gdpr') app.extensions['schedula_gdpr'] = self if 'schedula_admin' in app.extensions: admin = app.extensions['schedula_admin'] for v in (Consent,): admin.add_model(v, category="GDPR")