Accounts will not sync for new installs
See original GitHub issueDescribe the bug When trying to sync a new database using the env variable’s for API keys the sync returns “no results found”
To Reproduce
- Hook up dj-stripe to a new DJango app (no existing DB)
- Run the migrationsm then run djstripe_sync_models
- Observe that nothing syncs
- This may be because I have multiple stripe accounts under my login, though the keys should be different so maybe not.
Expected behavior Database data should sync between string and dj-stripe.
Environment
- dj-stripe version: 2.4.1
- Your Stripe account’s default API version: 2019-12-03
- Database: Postgres 10
- Python version: 3.7
- Django version: 3.0.2
Can you reproduce the issue with the latest version of master? I have not tried.
I am pretty sure I found the issue, though I am not sure of the implications of the change I made in order to get the sync to work. In September, the Account sync block was moved inside the for
loop, which prevents it from running no matter what I do to set things up differently (https://github.com/dj-stripe/dj-stripe/blob/ee72ca54b7c1c9e982170ab114c739d48661e54a/djstripe/management/commands/djstripe_sync_models.py#L74)
This is the change in question: https://github.com/dj-stripe/dj-stripe/commit/39acfcbfa356a8744458703dd71e8cc77194fe3d
Once I moved the line 64-75 block back to where it was, outside the for loop, the sync worked correctly and everything was fine.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top GitHub Comments
Hi @arnav13081994, sorry for the late reply.
I tried it out on the latest version (2.7.0b1), and I now see the warning in red on the console 😃
@shamjam in the pre-release and all future versions you need to have
API
keys in theDB
. The sync command should have outputted a warning on the console as well.