Clean up method arguments for templates
This commit is contained in:
parent
1414150787
commit
b704193f7c
@ -59,8 +59,7 @@ def check_id(form, field):
|
||||
raise validators.ValidationError('Leider keine gültige ID')
|
||||
|
||||
class AnswerForm(Form):
|
||||
used_id_list = create_used_id_list()
|
||||
user_id = StringField('Deine Id', [validators.InputRequired(), check_id])
|
||||
user_id = StringField('Id', [validators.InputRequired(), check_id])
|
||||
|
||||
|
||||
|
||||
@ -118,7 +117,7 @@ def solution():
|
||||
|
||||
@app.route('/result<user_id>')
|
||||
def result(user_id):
|
||||
return render_template('result.html', title='Sortierhut', hausname='Knuth', haustext='Mitglieder dieses Hauses mögen LaTeX-Anzüge und Eisbären.', id=user_id)
|
||||
return render_template('result.html', title='Sortierhut', id=user_id)
|
||||
|
||||
def convert_csv_to_list_of_lists(csv_file):
|
||||
list_of_lists = list()
|
||||
@ -148,7 +147,7 @@ def answers():
|
||||
if request.method == 'POST' and form.validate():
|
||||
ident = request.form['user_id']
|
||||
return redirect(url_for('view_answers', user_id=ident))
|
||||
return render_template('answers.html', form=form, title='Sortierhut', text='Hallo, Admin Fooboar')
|
||||
return render_template('answers.html', form=form, title='Sortierhut')
|
||||
|
||||
@app.route('/view_answers<user_id>')
|
||||
def view_answers(user_id):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user