-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* su for contest admins * Dont allow two_factor namespace for contest admins * Remove debug * Allow blocking urls and namespaces * Various limitations, tests * Add changes suggested in code review * Fix and optimize an old query * Use `filter_users_with_accessible_personal_data` for finding switchable users * Update __init__.py * Check if effective user is not a superuser * Fix bug * Add test for switching to a user which becomes superuser
- Loading branch information
1 parent
0139795
commit a5be176
Showing
13 changed files
with
389 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
An option for admins to log in as other user | ||
for testing purposes. | ||
|
||
You can enable su for contest admins with ``CONTEST_ADMINS_CAN_SU`` option set to ``True`` in ``settings.py``. By default | ||
this option is disabled. You can allow contest admins using su to make other request than `GET` by setting | ||
``ALLOW_ONLY_GET_FOR_SU_CONTEST_ADMINS`` to ``True`` (default ``False``). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% extends "simple-centered.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% block title %}{% trans "SU - Method not allowed" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="text-center mt-3"> | ||
<h3> | ||
{% blocktrans %} | ||
Sorry, this OIOIOI instance only allows GET requests for contest admins using su. | ||
{% endblocktrans %} | ||
</h3> | ||
<a href="{% url 'contest_dashboard' %}" class="btn btn-primary mt-3"> | ||
{% trans "Return to the contest" %} | ||
</a> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% extends "simple-centered.html" %} | ||
|
||
{% load i18n %} | ||
|
||
{% block title %}{% trans "SU - URL not allowed" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="text-center mt-3"> | ||
<h3> | ||
{% blocktrans %} | ||
Sorry, you can't access this page. | ||
{% endblocktrans %} | ||
</h3> | ||
<a href="{% url 'contest_dashboard' %}" class="btn btn-primary mt-3"> | ||
{% trans "Return to the contest" %} | ||
</a> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.