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
16056c4f
Project 'mj/mo-submit' was moved to 'mo-p/osmo'. Please update any links and bookmarks that may still have the old path.
Commit
16056c4f
authored
Mar 8, 2021
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Rights: Vyhodnocování práv při importování
parent
5c8d5174
No related branches found
No related tags found
1 merge request
!49
Stavy soutěže
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/imports.py
+3
-3
3 additions, 3 deletions
mo/imports.py
with
3 additions
and
3 deletions
mo/imports.py
+
3
−
3
View file @
16056c4f
...
...
@@ -674,7 +674,7 @@ class PointsImport(Import):
return
self
.
error
(
'
Soutěžící nesoutěží v této oblasti
'
)
rights
=
self
.
gatekeeper
.
rights_for_contest
(
pion
.
contest
)
if
not
rights
.
can_edit_points
(
self
.
round
):
if
not
rights
.
can_edit_points
():
return
self
.
error
(
'
Nemáte právo na úpravu bodů
'
)
user
=
pion
.
user
...
...
@@ -686,7 +686,7 @@ class PointsImport(Import):
return
if
not
self
.
allow_add_del
:
return
self
.
error
(
'
Tento soutěžící úlohu neodevzdal
'
)
if
not
rights
.
can_upload_solutions
(
round
):
if
not
rights
.
can_upload_solutions
():
return
self
.
error
(
'
Nemáte právo na zakládání nových řešení
'
)
sol
=
db
.
Solution
(
user_id
=
user_id
,
task_id
=
task_id
)
sess
.
add
(
sol
)
...
...
@@ -702,7 +702,7 @@ class PointsImport(Import):
return
self
.
error
(
'
Tento soutěžící úlohu odevzdal
'
)
if
sol
.
final_submit
is
not
None
or
sol
.
final_feedback
is
not
None
:
return
self
.
error
(
'
Nelze smazat řešení, ke kterému existují odevzdané soubory
'
)
if
not
rights
.
can_upload_solutions
(
round
):
if
not
rights
.
can_upload_solutions
():
return
self
.
error
(
'
Nemáte právo na mazání řešení
'
)
logger
.
info
(
f
'
Import: Smazáno řešení user=#
{
user_id
}
task=#
{
task_id
}
'
)
mo
.
util
.
log
(
...
...
...
...
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