Skip to content

Commit

Permalink
Defaulted webhook endpoint version to the configured setting
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav13081994 committed Nov 16, 2023
1 parent 845a1a9 commit e07e3ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions djstripe/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from stripe.error import AuthenticationError, InvalidRequestError, PermissionError

from djstripe import enums, models, utils
from djstripe.settings import djstripe_settings
from djstripe.signals import ENABLED_EVENTS


Expand Down Expand Up @@ -219,6 +220,12 @@ def _post_clean(self):

return super()._post_clean()

def get_initial_for_field(self, field, field_name):
if field_name == "api_version":
return djstripe_settings.STRIPE_API_VERSION
return super().get_initial_for_field(field, field_name)



class WebhookEndpointAdminEditForm(WebhookEndpointAdminBaseForm):
enabled_events = forms.MultipleChoiceField(
Expand Down

0 comments on commit e07e3ca

Please sign in to comment.