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
b7940fa0
Commit
b7940fa0
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Práva: Job na upload feedbacku
parent
727ae889
No related branches found
No related tags found
1 merge request
!19
Reforma vyhodnocování práv
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/jobs/submit.py
+5
-9
5 additions, 9 deletions
mo/jobs/submit.py
with
5 additions
and
9 deletions
mo/jobs/submit.py
+
5
−
9
View file @
b7940fa0
...
@@ -13,7 +13,7 @@ import zipfile
...
@@ -13,7 +13,7 @@ import zipfile
import
mo.db
as
db
import
mo.db
as
db
from
mo.jobs
import
TheJob
,
job_handler
,
job_file_path
from
mo.jobs
import
TheJob
,
job_handler
,
job_file_path
import
mo.r
ight
s
from
mo.rights
import
R
ight
from
mo.submit
import
Submitter
,
SubmitException
from
mo.submit
import
Submitter
,
SubmitException
from
mo.util
import
logger
,
data_dir
from
mo.util
import
logger
,
data_dir
from
mo.util_format
import
inflect_number
,
inflect_by_number
from
mo.util_format
import
inflect_number
,
inflect_by_number
...
@@ -169,17 +169,13 @@ def handle_upload_feedback(the_job: TheJob):
...
@@ -169,17 +169,13 @@ def handle_upload_feedback(the_job: TheJob):
.
filter
(
db
.
Participation
.
user_id
.
in_
(
user_dict
.
keys
()))
.
filter
(
db
.
Participation
.
user_id
.
in_
(
user_dict
.
keys
()))
.
all
())
.
all
())
rr
=
mo
.
rights
.
Rights
(
job
.
user
)
rights_cache
=
{}
user_rights
=
{}
user_rights
=
{}
for
user
,
pion
,
contest
in
rows
:
for
user
,
pion
,
contest
in
rows
:
user_dict
[
user
.
user_id
]
=
user
user_dict
[
user
.
user_id
]
=
user
if
contest
.
contest_id
not
in
rights_cache
:
rr
=
the_job
.
gatekeeper
.
rights_for_contest
(
contest
)
rr
.
get_for_contest
(
contest
)
user_rights
[
user
.
user_id
]
=
(
rights_cache
[
contest
.
contest_id
]
=
(
rr
.
have_right
(
Right
.
upload_submits
)
rr
.
have_right
(
mo
.
rights
.
Right
.
upload_submits
)
or
(
rr
.
have_right
(
Right
.
upload_feedback
)
and
round
.
state
==
db
.
RoundState
.
grading
))
or
(
rr
.
have_right
(
mo
.
rights
.
Right
.
upload_feedback
)
and
round
.
state
==
db
.
RoundState
.
grading
))
user_rights
[
user
.
user_id
]
=
rights_cache
[
contest
.
contest_id
]
for
f
in
files
:
for
f
in
files
:
f
.
user
=
user_dict
[
f
.
user_id
]
f
.
user
=
user_dict
[
f
.
user_id
]
...
...
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