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
MO-P
Odevzdávací Systém MO
Commits
f57c4690
Commit
f57c4690
authored
Jan 15, 2022
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Opraveny redirecty okolo zpracování skenů
Rozbil jsem v commitech
cb13aa00
a
f6e5479a
. Teď by to mělo fungovat tak, jak Jirka zamýšlel.
parent
9767d8a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/org_contest.py
+9
-4
9 additions, 4 deletions
mo/web/org_contest.py
with
9 additions
and
4 deletions
mo/web/org_contest.py
+
9
−
4
View file @
f57c4690
...
@@ -1759,7 +1759,7 @@ def org_contest_scans(ct_id: int, site_id: Optional[int] = None):
...
@@ -1759,7 +1759,7 @@ def org_contest_scans(ct_id: int, site_id: Optional[int] = None):
in_file_names
=
[
f
.
stream
.
name
for
f
in
files
],
in_file_names
=
[
f
.
stream
.
name
for
f
in
files
],
)
)
flash
(
'
Zpracování skenů zahájeno. Vyčkejte chvíli, než budou připraveny, a poté je roztřiďte.
'
,
'
success
'
)
flash
(
'
Zpracování skenů zahájeno. Vyčkejte chvíli, než budou připraveny, a poté je roztřiďte.
'
,
'
success
'
)
return
redirect
(
ctx
.
url_for
(
'
org_contest_scans
'
))
return
redirect
(
ctx
.
url_for
(
'
org_contest_scans
_process
'
,
job_id
=
job_id
))
jobs_query
=
sess
.
query
(
db
.
Job
).
filter_by
(
type
=
db
.
JobType
.
process_scans
)
jobs_query
=
sess
.
query
(
db
.
Job
).
filter_by
(
type
=
db
.
JobType
.
process_scans
)
if
not
g
.
user
.
is_admin
:
if
not
g
.
user
.
is_admin
:
...
@@ -1822,9 +1822,6 @@ def org_contest_scans_process(ct_id: int, job_id: int, site_id: Optional[int] =
...
@@ -1822,9 +1822,6 @@ def org_contest_scans_process(ct_id: int, job_id: int, site_id: Optional[int] =
return
redirect
(
ctx
.
url_for
(
'
org_contest_scans
'
))
return
redirect
(
ctx
.
url_for
(
'
org_contest_scans
'
))
if
not
g
.
user
.
is_admin
and
g
.
user
.
user_id
!=
job
.
user_id
:
if
not
g
.
user
.
is_admin
and
g
.
user
.
user_id
!=
job
.
user_id
:
raise
werkzeug
.
exceptions
.
Forbidden
()
raise
werkzeug
.
exceptions
.
Forbidden
()
if
job
.
state
!=
db
.
JobState
.
done
:
flash
(
'
Dávka naskenovaných úloh nebyla dosud dokončena.
'
)
return
redirect
(
ctx
.
url_for
(
'
org_contest_scans
'
))
if
'
type
'
in
job
.
in_json
and
job
.
in_json
[
'
type
'
]
==
'
feedback
'
:
if
'
type
'
in
job
.
in_json
and
job
.
in_json
[
'
type
'
]
==
'
feedback
'
:
scans_type
=
'
feedback
'
scans_type
=
'
feedback
'
...
@@ -1838,6 +1835,14 @@ def org_contest_scans_process(ct_id: int, job_id: int, site_id: Optional[int] =
...
@@ -1838,6 +1835,14 @@ def org_contest_scans_process(ct_id: int, job_id: int, site_id: Optional[int] =
if
scans_type
==
'
feedback
'
and
not
ctx
.
rights
.
can_upload_feedback
():
if
scans_type
==
'
feedback
'
and
not
ctx
.
rights
.
can_upload_feedback
():
raise
werkzeug
.
exceptions
.
Forbidden
()
raise
werkzeug
.
exceptions
.
Forbidden
()
if
job
.
state
!=
db
.
JobState
.
done
:
return
render_template
(
'
org_contest_scans_process.html
'
,
ctx
=
ctx
,
job
=
job
,
scans_type
=
scans_type
,
)
pages
=
sess
.
query
(
db
.
ScanPage
).
filter_by
(
job_id
=
job_id
).
order_by
(
'
file_nr
'
,
'
page_nr
'
).
all
()
pages
=
sess
.
query
(
db
.
ScanPage
).
filter_by
(
job_id
=
job_id
).
order_by
(
'
file_nr
'
,
'
page_nr
'
).
all
()
tasks
=
sess
.
query
(
db
.
Task
).
filter
(
db
.
Task
.
task_id
.
in_
(
job
.
in_json
[
'
task_ids
'
])).
order_by
(
'
code
'
).
all
()
tasks
=
sess
.
query
(
db
.
Task
).
filter
(
db
.
Task
.
task_id
.
in_
(
job
.
in_json
[
'
task_ids
'
])).
order_by
(
'
code
'
).
all
()
pion_query
=
sess
.
query
(
db
.
Participation
).
filter
(
pion_query
=
sess
.
query
(
db
.
Participation
).
filter
(
...
...
...
...
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
sign in
to comment