Skip to content

Commit

Permalink
fix migration path
Browse files Browse the repository at this point in the history
  • Loading branch information
sravfeyn committed Dec 15, 2024
1 parent 1f735c5 commit 60e9fcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Migration(migrations.Migration):
dependencies = [
("opportunity", "0060_completedwork_payment_date"),
("opportunity", "0062_opportunityaccess_invited_date"),
]

operations = [
Expand Down
8 changes: 4 additions & 4 deletions commcare_connect/opportunity/payment_number_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 60e9fcb

Please sign in to comment.