-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Creating WebhooksEndpoint locally raises tolerance constraint failed error #1955
Comments
Had the same problem and this fixed it. +1 |
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes dj-stripe#1955
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes dj-stripe#1955
StringDataRightTruncation: value too long for type character varying(15) sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes dj-stripe#1955
StringDataRightTruncation: value too long for type character varying(15) sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes dj-stripe#1955
I am having the same issue. PabloCastellano's fix works. When might this get merged? As of now, it is impossible to create webhooks that work until this fix is integrated. |
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes dj-stripe#1955
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes #1955
In description to 2.8 version:
so, probably need to change to: |
Thank you @KvyatkovskyAleksey. |
This is still an issue. I had to do something and modify the site-packages/djstripe module to get this to work just like OP. I appreciate it. Version: djstripe=2.8.1 |
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes #1955
Describe the bug
Attempting to create new WebhookEndpoint via django admin fails with
djstripe.models.webhooks.WebhookEndpoint.DoesNotExist: WebhookEndpoint matching query does not exist.
above error is caused by failure to create local object:
sqlite:
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance
mysql:
MySQLdb.IntegrityError: (1048, "Column 'tolerance' cannot be null")
The WebhookEndpoint is successfully created in stripe, but not in the local DB.
To Reproduce
Steps to reproduce the behavior:
python3 manage.py migrate && python3 manage.py runserver
python3 manage.py djstripe_sync_models
Expected behavior
A new WebhookEndpoint is created in local django app
Environment
Can you reproduce the issue with the latest version of master?
Yes
It appears that the API does not return the
tolerance
key, so somewhere along the line this field is explicitly set toNone
, which eventually causes the errorIntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance
(as opposed to the default value being used as defined in the model).This issue can be easily reproduced by modifying the webhook fixture (
tests/fixtures/webhook_endpoint_fake0001.json
) to remove thetolerance
key, and running pytest.I'm very new to dj-stripe, but issue can be resolved by adding a check to
models.webhooks.WebhookEndpoint._attach_objects_hook
:If this is actually a bug, and the proposed fix looks good, I'd be happy to contribute a PR.
The text was updated successfully, but these errors were encountered: