-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update auth backend to work with django 1.11 #2
Conversation
In django 1.11 the request obbject is passed to authenticate method as kwargs, this arg should not be passed to the method that creates the user object.
@@ -147,7 +147,7 @@ def get_context_data(self, **context): | |||
:rtype: dict | |||
""" | |||
context[self.redirect_field_name] = self.get_success_url() | |||
return context | |||
return super(LoginView, self).get_context_data(**context) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, I purposely didn't want the super, because it puts the form
object in the context which caused an issue with AJAX requests. You only changed a few lines, so I will merge your fixes in then run my tests and see what happens. You should be able to run the tests also if you want make coverage
does things in the correct order. Thanks for the fixes, I was going to find this issue in the next month or so anyway as I'll be needing this package for an SSO project I'm working on for Cisco.
I already run the test with te command "./manage.py tests", and I
added this line because some tests will fial without it.
There is a
test that shows the login view on a template and without this it was
failing. Maybe I'm missing something.
A 19/04/2017 03:25, Carl J.
Nobile escrigué:
@cnobile2012 commented on this pull request.
-------------------------
In django_pam/accounts/views.py [1]:
> @@ -147,7 +147,7 @@ def get_context_data(self, **context):
:rtype:
dict
"""
context[self.redirect_field_name] =
self.get_success_url()
- return context
+ return super(LoginView,
self).get_context_data(**context)
If I remember correctly, I
purposely didn't want the super, because it puts the form object in the
context which caused an issue with AJAX requests. You only changed a few
lines, so I will merge your fixes in then run my tests and see what
happens. You should be able to run the tests also if you want make
coverage does things in the correct order. Thanks for the fixes, I was
going to find this issue in the next month or so anyway as I'll be
needing this package for an SSO project I'm working on for Cisco.
--
You are receiving this because you authored the thread.
Reply to
this email directly, view it on GitHub [2], or mute the thread [3].
…--
Salutacions /
Regards
--------------------------------------------------------
Ferran
Pegueroles Forcadell
mailto:ferran@pegueroles.com
http://www.pegueroles.com
Links:
------
[1]
#2 (comment)
[2]
#2 (review)
[3]
https://github.com/notifications/unsubscribe-auth/AC4ngcLarWPT54YkR-QU3fNlePtNH29Mks5rxWKKgaJpZM4NA2PR
|
After I mentioned that you can run the tests I realized that the tests are not easy to run for this app. If you remember from my documentation on ReadTheDocs you need to make the user that the server runs in a member of the I haven't had the time yet to completely go through everything. I've been very busy with work and have little time right now. Hopefully, I'll get to it this weekend. |
Yesterday I already have looked inside the tests and already figured the .django_pam file. |
I have just pushed version 1.2 out to pypi. I moved your fix to inside the exception since that's where it will be used. No reason to execute code that may never get run. |
In django 1.11 the request obbject is passed to authenticate method as kwargs, this arg should not be passed to the method that creates the user object.