From c47208e384554bf760ace11465a58020a5c33f90 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 31 Jan 2020 16:52:14 -0800 Subject: [PATCH] Make deadline inconsistent with asap --- amanuensis/server/forms.py | 4 ++++ amanuensis/templates/lexicon/settings.html | 3 +++ 2 files changed, 7 insertions(+) diff --git a/amanuensis/server/forms.py b/amanuensis/server/forms.py index fad112f..c7feb7d 100644 --- a/amanuensis/server/forms.py +++ b/amanuensis/server/forms.py @@ -125,6 +125,10 @@ class LexiconConfigForm(FlaskForm): # And finally, the submit button submit = SubmitField("Submit") + def validate_publishDeadlines(form, field): + if form.publishAsap.data: + raise ValidationError('Cannot specify deadline if immediate publishing is enabled') + # TODO add validators that call into extant valid check methods def set_options(self, lexicon): diff --git a/amanuensis/templates/lexicon/settings.html b/amanuensis/templates/lexicon/settings.html index 6598d6b..6a937c7 100644 --- a/amanuensis/templates/lexicon/settings.html +++ b/amanuensis/templates/lexicon/settings.html @@ -84,6 +84,9 @@ {{ form.publishDeadlines(autocomplete="off") }} {{ form.publishDeadlines.label }}
{{ flag_setting(form.publishAsap) }} + {% for error in form.publishDeadlines.errors %} + {{ error }}
+ {% endfor %} {{ flag_setting(form.publishBlockOnReady) }} {{ number_setting(form.publishQuorum) }}