Flask-WTF フォームを使用しており、次のコードがあります。
forms.py で
class DealForm( Form ):
country = SelectField( 'Country' )
main.py で
if not form.validate_on_submit():
form = DealForm()
form.country.choices = [('us','USA'),('gb','Great Britain'),('ru','Russia')]
return render_template( 'index.html', user = current_user, form = form )
else:
return render_template( 'index.html', form = form )
country.choices が None であるため、POST から戻るとエラーが発生します。何が間違っていますか?