Skip to content
Snippets Groups Projects
Commit e8fbdb2f authored by Jiří Setnička's avatar Jiří Setnička
Browse files

Rounds: tasks_file je NULL když není

Zároveň kontrola stačí i bez 'is not None'.
parent ad8dc435
No related branches found
No related tags found
2 merge requests!12Účastnická část webu podporuje všechny stavy kola,!9WIP: Zárodek uživatelské části webu a submitování
...@@ -208,8 +208,8 @@ class Round(Base): ...@@ -208,8 +208,8 @@ class Round(Base):
def task_statement_available(self) -> bool: def task_statement_available(self) -> bool:
# Zde jsme raději přepečliví... # Zde jsme raději přepečliví...
return (self.state != RoundState.preparing return (self.state != RoundState.preparing
and self.tasks_file is not None and self.tasks_file
and self.ct_tasks_start is not None and self.ct_tasks_start
and mo.now >= self.ct_tasks_start) and mo.now >= self.ct_tasks_start)
def ct_can_submit(self) -> bool: def ct_can_submit(self) -> bool:
......
...@@ -250,7 +250,7 @@ class RoundEditForm(FlaskForm): ...@@ -250,7 +250,7 @@ class RoundEditForm(FlaskForm):
state = wtforms.SelectField("Stav kola", choices=db.RoundState.choices(), coerce=db.RoundState.coerce) state = wtforms.SelectField("Stav kola", choices=db.RoundState.choices(), coerce=db.RoundState.coerce)
# Only the desktop Firefox does not support datetime-local field nowadays, # Only the desktop Firefox does not support datetime-local field nowadays,
# other browsers does provide date and time picker UI :( # 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( ct_tasks_start = DateTimeLocalField(
"Čas zveřejnění úloh", validators=[validators.Optional()], "Čas zveřejnění úloh", validators=[validators.Optional()],
description="Ve formátu 2020-01-01 00:00:00" description="Ve formátu 2020-01-01 00:00:00"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment