Skip to content

Commit

Permalink
Make APIKey.secret unique
Browse files Browse the repository at this point in the history
This is required because we get_or_create with it.
Also it makes logical sense.
  • Loading branch information
jleclanche committed Jun 11, 2020
1 parent 1479fc9 commit a055942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djstripe/models/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class APIKey(StripeModel):
type = StripeEnumField(enum=APIKeyType)
name = models.CharField("Key name", max_length=100, blank=True)
secret = models.CharField(
max_length=50, validators=[RegexValidator(regex=API_KEY_REGEX)]
max_length=50, validators=[RegexValidator(regex=API_KEY_REGEX)], unique=True
)

def get_stripe_dashboard_url(self):
Expand Down

0 comments on commit a055942

Please sign in to comment.