Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to set a different set of languages allowed to submit per … #2828

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

meisterT
Copy link
Member

…contest.

If empty, falls back to the global definition.

This is part of #2521.

@meisterT meisterT force-pushed the langcontest branch 5 times, most recently from 0270585 to 4a79f9d Compare November 23, 2024 17:35
Copy link
Member

@nickygerritsen nickygerritsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also one phpcs annotation.

webapp/templates/jury/contest.html.twig Outdated Show resolved Hide resolved
…contest.

If empty, falls back to the global definition.

This is part of DOMjudge#2521.
@@ -453,9 +453,10 @@ public function submitSolution(
throw new BadRequestHttpException('Submissions for contest (temporarily) disabled');
}

if (!$language->getAllowSubmit()) {
$allowedLanguages = $this->dj->getAllowedLanguagesForContest($contest);
if (!in_array($language, $allowedLanguages, true)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, maybe consider:

Suggested change
if (!in_array($language, $allowedLanguages, true)) {
if (!in_array($language, $allowedLanguages, strict: true)) {

@meisterT meisterT added this pull request to the merge queue Nov 24, 2024
Merged via the queue into DOMjudge:main with commit 063b687 Nov 24, 2024
32 checks passed
@meisterT meisterT deleted the langcontest branch November 24, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants