From 60e9fcb3255715c32352f60dfe112bd82e8be9fb Mon Sep 17 00:00:00 2001 From: Sravan Reddy Date: Sun, 15 Dec 2024 20:27:02 +0530 Subject: [PATCH] fix migration path --- ...uired.py => 0063_opportunity_payment_info_required.py} | 2 +- commcare_connect/opportunity/payment_number_report.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename commcare_connect/opportunity/migrations/{0061_opportunity_payment_info_required.py => 0063_opportunity_payment_info_required.py} (84%) diff --git a/commcare_connect/opportunity/migrations/0061_opportunity_payment_info_required.py b/commcare_connect/opportunity/migrations/0063_opportunity_payment_info_required.py similarity index 84% rename from commcare_connect/opportunity/migrations/0061_opportunity_payment_info_required.py rename to commcare_connect/opportunity/migrations/0063_opportunity_payment_info_required.py index 84f5255b..5cd2ab93 100644 --- a/commcare_connect/opportunity/migrations/0061_opportunity_payment_info_required.py +++ b/commcare_connect/opportunity/migrations/0063_opportunity_payment_info_required.py @@ -5,7 +5,7 @@ class Migration(migrations.Migration): dependencies = [ - ("opportunity", "0060_completedwork_payment_date"), + ("opportunity", "0062_opportunityaccess_invited_date"), ] operations = [ diff --git a/commcare_connect/opportunity/payment_number_report.py b/commcare_connect/opportunity/payment_number_report.py index 80d80766..6caf2c1f 100644 --- a/commcare_connect/opportunity/payment_number_report.py +++ b/commcare_connect/opportunity/payment_number_report.py @@ -94,17 +94,17 @@ def object_list(self): usernames = OpportunityAccess.objects.filter(opportunity_id=opportunity).values_list( "user__username", flat=True ) - connecteid_statuses = fetch_payment_phone_numbers(usernames, status) + connectid_statuses = fetch_payment_phone_numbers(usernames, status) # display local status when its overridden local_statuses = OrgUserPaymentNumberStatus.objects.filter( user__username__in=usernames, organization=self.request.org ) local_statuses_by_username = {status.username: status for status in local_statuses} - for status in connecteid_statuses: + for status in connectid_statuses: local_status = local_statuses_by_username.get(status["username"]) if local_status and local_status.phone_number == status["phone_number"]: status["status"] = local_status.status - return connecteid_statuses + return connectid_statuses def post(self, request, *args, **kwargs): user_statuses = defaultdict(dict) @@ -228,7 +228,7 @@ def update_payment_number_statuses(update_data, opportunity): if connectid_updates: response = update_payment_statuses(connectid_updates) - if response.status not in [200, 201]: + if response.status_code not in [200, 201]: raise Exception("Error sending payment number status updates to ConnectID") if rejected_usernames: