Skip to content
Snippets Groups Projects
Commit 8779efd6 authored by Martin Mareš's avatar Martin Mareš
Browse files

Kolo nelze přepnout ze stavu "preparing", dokud není nastaven čas začátku

parent 4b44aeec
No related branches found
No related tags found
1 merge request!49Stavy soutěže
......@@ -7,7 +7,7 @@ from sqlalchemy.sql.functions import coalesce
from typing import Optional, Tuple
import werkzeug.exceptions
import wtforms
from wtforms import validators
from wtforms import validators, ValidationError
from wtforms.fields.html5 import IntegerField
import mo
......@@ -419,6 +419,10 @@ class RoundEditForm(FlaskForm):
)
submit = wtforms.SubmitField('Uložit')
def validate_state(self, field):
if field.data != db.RoundState.preparing and self.ct_tasks_start.data is None:
raise ValidationError('Není-li nastaven času začátku soutěže, stav musí být "připravuje se"')
@app.route('/org/contest/r/<int:id>/edit', methods=('GET', 'POST'))
def org_round_edit(id: int):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment