Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
2f16fe75
Commit
2f16fe75
authored
4 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Rounds: tasks_file je NULL když není
Zároveň kontrola stačí i bez 'is not None'.
parent
35aee941
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/db.py
+2
-2
2 additions, 2 deletions
mo/db.py
mo/web/org_round.py
+1
-1
1 addition, 1 deletion
mo/web/org_round.py
with
3 additions
and
3 deletions
mo/db.py
+
2
−
2
View file @
2f16fe75
...
@@ -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
can_submit
(
self
)
->
bool
:
def
can_submit
(
self
)
->
bool
:
...
...
This diff is collapsed.
Click to expand it.
mo/web/org_round.py
+
1
−
1
View file @
2f16fe75
...
@@ -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
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment