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

su for contest admins #400

Merged
merged 13 commits into from
Sep 11, 2024

Conversation

MasloMaslane
Copy link
Member

@MasloMaslane MasloMaslane commented Sep 4, 2024

This PR adds an option for contest admins to su to participants in contests they admin. By default this option is disabled and can be enabled by setting CONTEST_ADMINS_CAN_SU to True in settings.py. Also by default, contest admins using su can't make requests other than GET. This can be changed by setting ALLOW_ONLY_GET_FOR_SU_CONTEST_ADMINS to True in settings.

When a contest admin using su tries to change to another contest or go to an url which is not in the contest (doesn't have /c/id/...), they are redirected to the dashboard of the original contest. This unfortunately still allows to go to to sites like editing profile info, because the url starts with /c/id/. This is the reason that by default only GET requests are allowed.

This feature is highly sought after by the OI Jury

oioioi/su/views.py Outdated Show resolved Hide resolved
@MasloMaslane MasloMaslane marked this pull request as ready for review September 5, 2024 13:14
oioioi/su/README.rst Show resolved Hide resolved
oioioi/su/urls.py Outdated Show resolved Hide resolved
oioioi/su/views.py Outdated Show resolved Hide resolved
oioioi/su/views.py Outdated Show resolved Hide resolved
oioioi/su/__init__.py Outdated Show resolved Hide resolved
oioioi/su/middleware.py Outdated Show resolved Hide resolved
oioioi/su/middleware.py Show resolved Hide resolved
oioioi/su/__init__.py Outdated Show resolved Hide resolved
oioioi/su/views.py Outdated Show resolved Hide resolved
@MasloMaslane MasloMaslane merged commit a5be176 into sio2project:master Sep 11, 2024
1 check failed
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.

[Scoreboard] Allow contest admins to see scoreboard that is currently displayed to contestants
2 participants