-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support for SU from Python #84
base: develop
Are you sure you want to change the base?
Conversation
…allow for suing in from python
The error common to all 3 failing tests occurs when github actions uses typing_extensions version 4.8 which drops support for python 3.7.
The error on the These errors are independent of django-su and not introduced by my pull request (no django-su code appears in the stack trace). Thanks |
… it installs an incompatible version of typing-extensions for python 3.7
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #84 +/- ##
===========================================
- Coverage 94.46% 93.31% -1.16%
===========================================
Files 9 9
Lines 307 314 +7
===========================================
+ Hits 290 293 +3
- Misses 17 21 +4
☔ View full report in Codecov by Sentry. |
- Made test_login_user_id_invalid actually check an invalid id - added test_login_success_without_custom_login_action - added test for auth.change_user permission check when calling su_in from user code
Can you rerun the github action? All of my changes since originally making the pull request have been to the github actions and automated testing. I've verified that they succeed on my fork. |
A Django app I'm working on surfaced the need to SU directly from python. Unfortunately, as Django doesn't support redirecting with POST and django-su's
login_as_user
view only allows POST requests, this isn't possible.To enable this I moved a majority of the
login_as_user
function to a new function:su_in
in utils.This enables apps using django-su to optionally SU users without requiring logging in through Django's Admin app.
I chose this over allowing GET requests to
login_as_user
since that seemed to have security implications and made redirecting back to the original page more janky.