def decorated_function(*args, **kwargs): login_status, user = logins.check_allowed(request, 2) request.logged_in_user = user if login_status: return f(*args, **kwargs) if user: return redirect("505") flash("You must log in via your Eventbrite Order ID and the Day Password before you can access that page.", "danger") return redirect(url_for('public_routes.index'))
def files_download(workshop_id, filename): file = database.get_file_for_download( workshop_id, "static/files/{}/{}".format(workshop_id, filename)) login_status, user = logins.check_allowed(request, 3) if file.file_permission == "Public" or ( file.file_permission == "Jam team only" and login_status): return send_file(file.file_path) else: abort(404)
def decorated_function(*args, **kwargs): login_status, user = logins.check_allowed(request, 3) request.logged_in_user = user if login_status: return f(*args, **kwargs) if user: return redirect("505") flash("You do not currently have permission to access the requested page. Please log in first.", "danger") return redirect(url_for('public_routes.login', next=request.url))