Quick fix to ensure that billing doesn't fail if the crown is not set

for the service.

The letters rates for cronw and non crown are the same. It would be nice
to remove the need for crown but for now this is a quick fix.
This commit is contained in:
Rebecca Law
2021-03-23 16:07:57 +00:00
parent 1903e8f268
commit 057c4e4568
3 changed files with 20 additions and 4 deletions

View File

@@ -455,6 +455,8 @@ def get_rate(
if notification_type == LETTER_TYPE:
if letter_page_count == 0:
return 0
# if crown is not set default to true, this is okay because the rates are the same for both crown and non-crown.
crown = crown or True
return next(
r.rate
for r in letter_rates if (