From cdea172bb5d201786ec5eb73d8544b0d5c8dc8b3 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Thu, 9 Sep 2021 18:06:53 -0700 Subject: [PATCH] Remove CSFR from subforms --- amanuensis/server/lexicon/settings/forms.py | 5 +++++ amanuensis/server/lexicon/settings/settings.jinja | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/amanuensis/server/lexicon/settings/forms.py b/amanuensis/server/lexicon/settings/forms.py index 6b0f10c..74c424f 100644 --- a/amanuensis/server/lexicon/settings/forms.py +++ b/amanuensis/server/lexicon/settings/forms.py @@ -59,6 +59,11 @@ def parse_index_type(type_str): class IndexDefinitionForm(FlaskForm): """/lexicon//settings/index/""" + class Meta: + # Disable CSRF on the individual index definitions, since the schema + # form will have one + csrf = False + TYPE_CHOICES = ([("", "")] + [(str(t), str(t).lower()) for t in IndexType]) index_type = SelectField(choices=TYPE_CHOICES, coerce=parse_index_type) diff --git a/amanuensis/server/lexicon/settings/settings.jinja b/amanuensis/server/lexicon/settings/settings.jinja index 1e4eecd..c9a9faf 100644 --- a/amanuensis/server/lexicon/settings/settings.jinja +++ b/amanuensis/server/lexicon/settings/settings.jinja @@ -105,7 +105,6 @@ Cap {% for index_form in form.indices %} - {{ index_form.hidden_tag() }} {{ index_form.index_type() }} {{ index_form.pattern() }}