From 82129aba407dfdd3ed8dec69930ad6e55ce85e09 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 27 Apr 2020 17:16:02 -0700 Subject: [PATCH] Move join forms to server.lexicon --- amanuensis/server/forms.py | 8 +------- amanuensis/server/lexicon/__init__.py | 3 ++- amanuensis/server/lexicon/forms.py | 8 ++++++++ 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 amanuensis/server/lexicon/forms.py diff --git a/amanuensis/server/forms.py b/amanuensis/server/forms.py index a2805e8..b3c5ad4 100644 --- a/amanuensis/server/forms.py +++ b/amanuensis/server/forms.py @@ -1,7 +1,7 @@ from flask import current_app from flask_wtf import FlaskForm from wtforms import ( - StringField, PasswordField, BooleanField, SubmitField, TextAreaField, + StringField, BooleanField, SubmitField, TextAreaField, IntegerField, SelectField, RadioField) from wtforms.validators import DataRequired, ValidationError, Optional from wtforms.widgets.html5 import NumberInput @@ -193,12 +193,6 @@ class LexiconConfigForm(FlaskForm): # return True -class LexiconJoinForm(FlaskForm): - """/lexicon//join/""" - password = StringField('Password') - submit = SubmitField('Submit') - - class LexiconCharacterForm(FlaskForm): """/lexicon//session/character/""" characterName = StringField( diff --git a/amanuensis/server/lexicon/__init__.py b/amanuensis/server/lexicon/__init__.py index f75f449..7b19ef7 100644 --- a/amanuensis/server/lexicon/__init__.py +++ b/amanuensis/server/lexicon/__init__.py @@ -10,11 +10,12 @@ from flask_login import login_required, current_user from amanuensis.lexicon import player_can_join_lexicon, add_player_to_lexicon from amanuensis.parser import filesafe_title -from amanuensis.server.forms import LexiconJoinForm from amanuensis.server.helpers import ( lexicon_param, player_required_if_not_public) +from .forms import LexiconJoinForm + bp_lexicon = Blueprint('lexicon', __name__, url_prefix='/lexicon/', diff --git a/amanuensis/server/lexicon/forms.py b/amanuensis/server/lexicon/forms.py new file mode 100644 index 0000000..2305024 --- /dev/null +++ b/amanuensis/server/lexicon/forms.py @@ -0,0 +1,8 @@ +from flask_wtf import FlaskForm +from wtforms import StringField, SubmitField + + +class LexiconJoinForm(FlaskForm): + """/lexicon//join/""" + password = StringField('Password') + submit = SubmitField('Submit')