Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
f19caeeb
Commit
f19caeeb
authored
Mar 27, 2020
by
Robert Czechowski
Browse files
Fix: Do not autostart contests that require login
parent
e6bff6c3
Pipeline
#582
passed with stages
in 28 minutes and 34 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/core.rs
View file @
f19caeeb
...
...
@@ -293,7 +293,12 @@ pub fn show_contest<T: MedalConnection>(conn: &T, contest_id: i32, session_token
// TODO: Should participation start automatically for teacher? Even before the contest start?
// Should teachers have all time access or only the same limited amount of time?
// if opt_part.is_none() && (contest.duration == 0 || session.is_teacher) {
if
opt_part
.is_none
()
&&
contest
.duration
==
0
&&
constraints
.contest_running
&&
constraints
.grade_matching
{
if
opt_part
.is_none
()
&&
contest
.duration
==
0
&&
constraints
.contest_running
&&
constraints
.grade_matching
&&
contest
.requires_login
!=
Some
(
true
)
{
conn
.new_participation
(
&
session_token
,
contest_id
)
.map_err
(|
_
|
MedalError
::
AccessDenied
)
?
;
opt_part
=
Some
(
Participation
{
contest
:
contest_id
,
user
:
session
.id
,
start
:
time
::
get_time
()
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment