diff --git a/mo/db.py b/mo/db.py index e827ea09135eaffc62d33f1a6ca4590ec09d63c8..b76a4c1d89dad7c69191b4b3508d90410d98f0a0 100644 --- a/mo/db.py +++ b/mo/db.py @@ -208,8 +208,8 @@ class Round(Base): def task_statement_available(self) -> bool: # Zde jsme raději přepečliví... return (self.state != RoundState.preparing - and self.tasks_file is not None - and self.ct_tasks_start is not None + and self.tasks_file + and self.ct_tasks_start and mo.now >= self.ct_tasks_start) def ct_can_submit(self) -> bool: diff --git a/mo/web/org_round.py b/mo/web/org_round.py index 1980e6a47be751307cd3be92f4bc14ef9cf4c927..86339bb25b1706325471734c78fb807ce21c1c8c 100644 --- a/mo/web/org_round.py +++ b/mo/web/org_round.py @@ -250,7 +250,7 @@ class RoundEditForm(FlaskForm): state = wtforms.SelectField("Stav kola", choices=db.RoundState.choices(), coerce=db.RoundState.coerce) # Only the desktop Firefox does not support datetime-local field nowadays, # other browsers does provide date and time picker UI :( - tasks_file = wtforms.StringField("Soubor se zadáním", description="Cesta k ručně uploadovanému souboru") + tasks_file = wtforms.StringField("Soubor se zadáním", description="Cesta k ručně uploadovanému souboru", filters=[lambda x: x or None]) ct_tasks_start = DateTimeLocalField( "Čas zveřejnění úloh", validators=[validators.Optional()], description="Ve formátu 2020-01-01 00:00:00"