Skip to content

Commit

Permalink
Renamed tolerance to djstripe_tolerance as it's a Djstripe specific f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
arnav13081994 authored and jleclanche committed Apr 25, 2024
1 parent 1dfa7d0 commit b18b527
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions djstripe/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def get_fieldsets(self, request, obj=None):
"metadata",
"api_version",
"djstripe_uuid",
"tolerance",
"djstripe_tolerance",
]
if obj.djstripe_uuid:
core_fields = [
Expand All @@ -768,7 +768,7 @@ def get_fieldsets(self, request, obj=None):
"metadata",
"api_version",
"enabled_events",
"tolerance",
"djstripe_tolerance",
]

return [
Expand Down
10 changes: 8 additions & 2 deletions djstripe/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class Meta:
"connect",
"api_version",
"metadata",
"tolerance",
"djstripe_tolerance",
)

# Hook into _post_clean() instead of save().
Expand Down Expand Up @@ -228,7 +228,13 @@ class WebhookEndpointAdminEditForm(WebhookEndpointAdminBaseForm):

class Meta:
model = models.WebhookEndpoint
fields = ("description", "base_url", "enabled_events", "metadata", "tolerance")
fields = (
"description",
"base_url",
"enabled_events",
"metadata",
"djstripe_tolerance",
)

def get_initial_for_field(self, field, field_name):
if field_name == "base_url":
Expand Down
2 changes: 1 addition & 1 deletion djstripe/models/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class WebhookEndpoint(StripeModel):
default=uuid4,
help_text="A UUID specific to dj-stripe generated for the endpoint",
)
tolerance = models.PositiveSmallIntegerField(
djstripe_tolerance = models.PositiveSmallIntegerField(
help_text="Controls the milliseconds tolerance which wards against replay attacks. Leave this to its default value unless you know what you're doing.",
default=stripe.Webhook.DEFAULT_TOLERANCE,
)
Expand Down

0 comments on commit b18b527

Please sign in to comment.