-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Move API Keys to Admin from settings file. #1993
base: master
Are you sure you want to change the base?
Conversation
sqlite3.IntegrityError: NOT NULL constraint failed: djstripe_webhookendpoint.tolerance Fixes #1955
Instead djstripe_settings.WEBHOOK_TOLERANCE, since it was removed (#1967)
* Updated BaseInvoice.retry to accept kwargs This was done so that kwargs can be passed down to Invoice.pay() * Updated Customer.send_invoice method This was done so that kwargs could be passed down to Invoice.pay(). * Formatting fix * Updated docs
Supercedes #1786
…them deterministic
…ue_account_api_key_default_per_key_type constraint
…ripe_apikey_secret_key constraint This constraint is created to handle violations of duplicate secret keys. This happens in case of adding an api key for non existent Platform accounts.
In case the key was added before the account was created, we end up creating the key before the Admin form gets created due to how the sync algorithm works. This commit will not correctly handle creation of APIKeys.
…ault In case the key was added before the account was created, we end up creating the key before the Admin form gets created due to how the sync algorithm works. This commit will not correctly handle creation of APIKeys.
…n settings if any
5bce53a
to
5b8b9e5
Compare
@jleclanche This PR is ready for review. |
djstripe/admin/forms.py
Outdated
fields = ["name", "djstripe_is_account_default"] | ||
|
||
@property | ||
def construct_custom_error_message(self): |
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.
Make this a separate helper function that takes the type and the account as arguments, instead of a class member.
Could you include screenshots here of what the changes look like in the admin? |
@jleclanche Changes made. Description updated with screenshots of add and edit admin views. |
bf4515d
to
d89e50e
Compare
Would like to have this merged so that I can switch everything to being managed through the database rather than having both settings and database. |
15e04c3
to
8727894
Compare
This PR makes the following changes:
LIVE_API_KEY
settingTEST_API_KEY
settingSTRIPE_SECRET_KEY
settingSTRIPE_LIVE_SECRET_KEY
settingSTRIPE_TEST_SECRET_KEY
settingGET_DEFAULT_STRIPE_SECRET_KEY
to get the default Secret API Key for the givenlivemode
anddjstripe_owner_account
stripe.api_key
in addition to adding API Keys to the db.djstripe_is_account_default
so that it can be deduced in an unambguous way the defaultapi_key
for a given keytype
,livemode
,djstripe_owner_account
whendjstripe_is_account_default
isTrue
.Please note there are no migrations and tests as all that would be taken together. I have verified manually that all existing flows work as expected.