Skip to content

Commit

Permalink
fix: Avoid errors when missing subscription information cache id (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan authored Feb 6, 2024
1 parent e79e14c commit d9a835f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/organisations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ def save_as_free_subscription(self):
if not getattr(self.organisation, "subscription_information_cache", None):
return

# There is a weird bug where the cache is present, but the id is unset.
# See here for more: https://flagsmith.sentry.io/issues/4945988284/
if not self.organisation.subscription_information_cache.id:
return

self.organisation.subscription_information_cache.delete()

def prepare_for_cancel(
Expand Down

0 comments on commit d9a835f

Please sign in to comment.