diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-07-31 17:49:41 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-07-31 17:49:41 +0100 |
| commit | c7900e5b1e2651a28410d13dfa58c37701b65692 (patch) | |
| tree | aa512be3dededdfe12a50b63f2cbf998cba652fe /app/auth | |
| parent | Clarify that points need to be clicked on (diff) | |
| download | AnnotateChange-c7900e5b1e2651a28410d13dfa58c37701b65692.tar.gz AnnotateChange-c7900e5b1e2651a28410d13dfa58c37701b65692.zip | |
Add terms and conditions to registration page
Diffstat (limited to 'app/auth')
| -rw-r--r-- | app/auth/forms.py | 4 | ||||
| -rw-r--r-- | app/auth/routes.py | 41 |
2 files changed, 43 insertions, 2 deletions
diff --git a/app/auth/forms.py b/app/auth/forms.py index 7758342..ea194a5 100644 --- a/app/auth/forms.py +++ b/app/auth/forms.py @@ -3,7 +3,7 @@ from flask import current_app from flask_wtf import FlaskForm -from wtforms import StringField, PasswordField, SubmitField +from wtforms import StringField, PasswordField, SubmitField, BooleanField from wtforms.validators import DataRequired, ValidationError, Email, EqualTo from app.models import User @@ -22,6 +22,8 @@ class RegistrationForm(FlaskForm): password2 = PasswordField( "Repeat Password", validators=[DataRequired(), EqualTo("password")] ) + toc = BooleanField("I agree to the Terms and Conditions.", + validators=[DataRequired(), ]) submit = SubmitField("Register") def validate_username(self, username): diff --git a/app/auth/routes.py b/app/auth/routes.py index 2a8a0bd..aa44e7d 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- import datetime +import markdown +import textwrap from flask import ( render_template, @@ -32,6 +34,41 @@ from app.models import User, Task from app.utils.tasks import generate_user_task +LEGAL = markdown.markdown( + textwrap.dedent( + """ + ## Terms and Conditions + + The AnnotateChange application is created to construct a data set for + the analysis of change point algorithms. As a user, you will be asked + to annotate time series data. It is important that we can use these + annotations freely and publish them under a permissive license. + + Therefore, we ask that you agree to the following terms and conditions. + + 1. Identifiable user data such as email address, password, and IP + address will not be shared by us with any third party, unless we are + required to do so by law. This information will only be used to provide + authentication to the application and verify that you have access to + the email address you provide us. + + 2. Annotations and any other information you provide us through use of + the application are provided to us under a worldwide, royalty-free, + non-exclusive, and perpetual license and can be made publically + available by us under a permissive license and used for whatever + purpose we see fit. In any publication of this annotation data users + will only be identified by a numeric ID, not by personal identifiable + information (such as email or IP address). + + 3. You agree that you will not revoke or seek invalidation of any + license that you have granted under these Terms and conditions for any + content you have provided us. + + """ + ) +) + + def auto_logout(): # Automatically logout after a period of inactivity # https://stackoverflow.com/a/40914886/1154005 @@ -109,7 +146,9 @@ def register(): ) return redirect(url_for("auth.login")) - return render_template("auth/register.html", title="Register", form=form) + return render_template( + "auth/register.html", title="Register", form=form, legal=LEGAL + ) @bp.route("/reset_password_request", methods=("GET", "POST")) |
