From b4b241600704cf1be963a1ff51191eec020434a4 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 23 Sep 2019 15:49:12 +0100 Subject: Add configuration option for accepting registrations --- app/auth/routes.py | 3 +++ app/templates/auth/no_register.html | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/templates/auth/no_register.html (limited to 'app') diff --git a/app/auth/routes.py b/app/auth/routes.py index 21b1a67..57bd605 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -133,6 +133,9 @@ def logout(): @bp.route("/register", methods=("GET", "POST")) def register(): + if not current_app.config['ACCEPTING_REGISTRATION']: + return render_template("auth/no_register.html") + if current_user.is_authenticated: return redirect(url_for("main.index")) form = RegistrationForm() diff --git a/app/templates/auth/no_register.html b/app/templates/auth/no_register.html new file mode 100644 index 0000000..9998e66 --- /dev/null +++ b/app/templates/auth/no_register.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% import 'bootstrap/wtf.html' as wtf %} + +{% block styles %} + {{ super() }} +{% endblock %} + +{% block app_content %} +

Register

+
+
+ Thank you for your interest in AnnotateChange. We are not currently looking + for new annotators, so registration has been disabled. If you already have + an account, you can login here. +
+
+{% endblock %} -- cgit v1.2.3