-
Notifications
You must be signed in to change notification settings - Fork 150
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
IntegrityError at /api/password_reset/ null value in column "ip_address" violates not-null constraint #34
Comments
If you need any logs, let me know what you need. |
Hi, it might be possible that your request does not have "ip address" set. You are probably using a reverse proxy or load balancer or a unix socket? Take a look at this PR and the comments, the |
This should be fixed by PR #40. It's not yet in a release, but it's in the master branch. |
Should be fixed by release 1.1.0rc1, you can install it using pip install "django-rest-passwordreset==1.1.0rc1" |
@anx-ckreuzberger cant get it to work 😞 |
Can you provide an error message/exception/...? |
in my case it does not work, because the:
returns empty string, not null add a validation and it worked :( solve it like this:
|
@anx-ckreuzberger I've also bumped to the pre-release version This is pretty weird because I've checked them about a hundred times but it still tries to set a null value for Any ideas? :) |
look for the file in your local project venv/lib... modify the file in the line that I put modify as I put in my previous comment |
I know I'm the one that pressed the merge button on PR #40 , but I guess # no token exists, generate a new token
token = ResetPasswordToken.objects.create(
user=user,
user_agent=request.META.get('HTTP_USER_AGENT',
getattr(settings, 'DJANGO_REST_PASSWORDRESET_HTTP_USER_AGENT', '')),
ip_address=request.META.get('REMOTE_ADDR',
getattr(settings, 'DJANGO_REST_PASSWORDRESET_REMOTE_ADDR', ''))
) is just wrong? I believe the implementation suggested by @vonorm here #40 (comment) is correct. Any thoughts? |
The idea is to work and not return error. The problem that I had was that this request.META.get ('REMOTE_ADDR') returned empty text and therefore never set the default value assigned from the setting. that say this: request.META.get ('REMOTE_ADDR', There are several alternatives, I suggested what worked for me |
The bugfixes have been released on PyPi in version 1.1.0rc3. You should be able install and test it using pip install django-rest-passwordreset==1.1.0rc3 |
I am still getting the error: null value in column "ip_address" violates not-null constraint Worked for me after migrating 👯♂ |
There is another error
|
Fixed since 1.4.0 |
Hi, I have a problem with this dependency on production server. Locally works very good, but problem appears on server. It Django issue is?
django-rest-passwordreset version: 0.9.7
Django: 1.11.5
The text was updated successfully, but these errors were encountered: