Invoice "status" does not sync
See original GitHub issueDescribe the bug A clear and concise description of what the bug is. Both locally, and in my production application, Invoice Status fields have stopped syncing.
Though, that’s not quite accurate. Specifically, they are all syncing to be an empty string ""
.
We used to have a valid status
on each Invoice, now we only have an empty string.
To Reproduce Steps to reproduce the behavior:
- In stripe dashboard create an Invoice with any status
- Fetch that invoice using
stripe_invoice = stripe.Invoice.retrieve(<invoice_id>)
- Run
invoice = Invoice.sync_from_stripe_data(stripe_invoice)
- check the
invoice.status
Expected behavior A clear and concise description of what you expected to happen.
I expected the status to match, instead it is an empty string.
Environment
- dj-stripe version: [stable/2.3.0]
- Your Stripe account’s default API version: [2019-09-09]
- Database: [Postgres]
- Python version: [e.g. 3.8]
- Django version: [e.g. 2.2.10]
Can you reproduce the issue with the latest version of master?
[Yes]
Additional context Add any other context about the problem here.
My first suspicion was that I think it might have something to do with the capitals in InvoiceStatusEnum
–
https://github.com/dj-stripe/dj-stripe/blob/df2913e22553a9897c1aacae1f52139cc7bca766/djstripe/enums.py#L329-L334
Since they are used to generate the choices for the StripeEnumField
. Stripe’s statuses don’t have any capitalization. They are lowercase only.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
No - I don’t think doing API calls during a migration is a good idea.
But you should be able to use
./manage.py djstripe_sync_models
after the migration to update any new fields - it’s not a bad idea to run that after each migration release.We should document that command, and also have some general documentation on the upgrade process - something similar to https://docs.djangoproject.com/en/3.0/howto/upgrade-version/ wouldn’t be a bad idea, since the process should be similar - aim to upgrade one feature release at a time (eg ~=2.2.x to ~=2.3.x), so you can test deprecation warnings at each release.
(edit - it would help if I got the command name right)
So yeah the command is documented here - https://dj-stripe.readthedocs.io/en/stable/usage/manually_syncing_with_stripe.html#command-line but it probably should be mentioned as part of a broader doc on how to upgrade.
Hmm I just noticed that the code examples are missing from the docs - see source here - https://github.com/dj-stripe/dj-stripe/blob/master/docs/usage/manually_syncing_with_stripe.rst