Skip to content

Commit

Permalink
ERP interface issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
szabozoltan69 committed Jul 17, 2024
1 parent 7567cf5 commit 1f3ac08
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions utils/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ def push_fr_data(data, retired=False):
if ERP_API_ENDPOINT == "x":
return
# Contacts
c_ifrc_names = ",".join(
data.contacts.filter(ctype__iexact="Federation").values_list("name", flat=True)
) # normally there is only 1
c_ns_names = ",".join(
data.contacts.filter(ctype__iexact="NationalSociety").values_list("name", flat=True)
) # normally there is only 1
names = data.contacts.filter(ctype__iexact="Federation").values_list("name", flat=True)
names[:] = (name[:20] for name in list(names)) # Temporary fix for F&O side field lenght issue
c_ifrc_names = ",".join(names) # normally there is only 1

names = data.contacts.filter(ctype__iexact="NationalSociety").values_list("name", flat=True)
names[:] = (name[:20] for name in list(names)) # Temporary fix for F&O side field lenght issue
c_ns_names = ",".join(names) # normally there is only 1

requestTitle = data.event.name if data.event else "-" # Emergency name

Expand Down Expand Up @@ -55,9 +56,9 @@ def push_fr_data(data, retired=False):
"""

if data.appeal != RequestChoices.NO:
InitialRequestType, InitialRequestValue = "EA", data.appeal_amount
InitialRequestType, InitialRequestValue = "EA", data.appeal_amount or 0
elif data.dref != RequestChoices.NO:
InitialRequestType, InitialRequestValue = "DREF", data.dref_amount
InitialRequestType, InitialRequestValue = "DREF", data.dref_amount or 0
else:
InitialRequestType, InitialRequestValue = "Empty", 0

Expand Down

0 comments on commit 1f3ac08

Please sign in to comment.