Skip to content

Commit

Permalink
Fix #1413 ensure plans always have default pricelists attached (regre…
Browse files Browse the repository at this point in the history
…ssion)
  • Loading branch information
chrisjsimpson committed Sep 21, 2024
1 parent ed33a79 commit 6b7b0a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion subscribie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,15 @@ def getPrice(self, currency):
log.debug(
f"Searching for price_list in currency {currency} for plan {self.title}" # noqa: E501
)

price_list_found_for_currency = False

# Ensure plan has at least default price lists attached
# https://github.com/Subscribie/subscribie/issues/1413
if len(self.price_lists) == 0:
log.debug("plan price_lists is zero. Calling assignDefaultPriceLists")
self.assignDefaultPriceLists()
database.session.commit()

for price_list in self.price_lists:
log.debug(f"only use price list if currency {currency}")

Expand Down

0 comments on commit 6b7b0a9

Please sign in to comment.