mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
ignore case in the cost_threshold in dvla response files
we failed when we received UNSORTED instead of Unsorted
This commit is contained in:
@@ -421,12 +421,11 @@ def update_letter_notifications_statuses(self, filename):
|
||||
for update in notification_updates:
|
||||
check_billable_units(update)
|
||||
update_letter_notification(filename, temporary_failures, update)
|
||||
sorted_letter_counts[update.cost_threshold] += 1
|
||||
sorted_letter_counts[update.cost_threshold.lower()] += 1
|
||||
|
||||
try:
|
||||
if sorted_letter_counts.keys() - {'Unsorted', 'Sorted'}:
|
||||
unknown_status = sorted_letter_counts.keys() - {'Unsorted', 'Sorted'}
|
||||
|
||||
unknown_status = sorted_letter_counts.keys() - {'unsorted', 'sorted'}
|
||||
if unknown_status:
|
||||
message = 'DVLA response file: {} contains unknown Sorted status {}'.format(
|
||||
filename, unknown_status
|
||||
)
|
||||
@@ -455,8 +454,8 @@ def persist_daily_sorted_letter_counts(day, file_name, sorted_letter_counts):
|
||||
daily_letter_count = DailySortedLetter(
|
||||
billing_day=day,
|
||||
file_name=file_name,
|
||||
unsorted_count=sorted_letter_counts['Unsorted'],
|
||||
sorted_count=sorted_letter_counts['Sorted']
|
||||
unsorted_count=sorted_letter_counts['unsorted'],
|
||||
sorted_count=sorted_letter_counts['sorted']
|
||||
)
|
||||
dao_create_or_update_daily_sorted_letter(daily_letter_count)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user