Compare commits

...

2 Commits

Author SHA1 Message Date
Patrick Jentsch
460257294d Use relative import for sub blueprints 2024-11-18 11:08:28 +01:00
Patrick Jentsch
2c43333c94 Check tos accepted in registration form 2024-11-18 11:03:29 +01:00
3 changed files with 7 additions and 3 deletions

View File

@ -60,7 +60,11 @@ class RegistrationForm(FlaskForm):
def validate_username(self, field): def validate_username(self, field):
if User.query.filter_by(username=field.data).first(): if User.query.filter_by(username=field.data).first():
raise ValidationError('Username already in use') raise ValidationError('Username already registered')
def validate_terms_of_use_accepted(self, field):
if not field.data:
raise ValidationError('Terms of Use not accepted')
class LoginForm(FlaskForm): class LoginForm(FlaskForm):

View File

@ -1,8 +1,8 @@
from flask_wtf.file import FileField, FileRequired from flask_wtf.file import FileField, FileRequired
from wtforms import StringField, ValidationError from wtforms import StringField, ValidationError
from wtforms.validators import InputRequired, Length from wtforms.validators import InputRequired, Length
from app.blueprints.contributions.forms import ContributionBaseForm, UpdateContributionBaseForm
from app.blueprints.services import SERVICES from app.blueprints.services import SERVICES
from ..forms import ContributionBaseForm, UpdateContributionBaseForm
class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm): class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):

View File

@ -1,7 +1,7 @@
from flask_wtf.file import FileField, FileRequired from flask_wtf.file import FileField, FileRequired
from wtforms import ValidationError from wtforms import ValidationError
from app.blueprints.contributions.forms import ContributionBaseForm, UpdateContributionBaseForm
from app.blueprints.services import SERVICES from app.blueprints.services import SERVICES
from ..forms import ContributionBaseForm, UpdateContributionBaseForm
class CreateTesseractOCRPipelineModelForm(ContributionBaseForm): class CreateTesseractOCRPipelineModelForm(ContributionBaseForm):