Skip to content

Commit

Permalink
[#2108] Fix budget items without value in IATI export
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Apr 12, 2016
1 parent f9955b1 commit 7e61bec
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions akvo/iati/exports/elements/budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,17 @@ def budget(project):
value_element = etree.SubElement(element, "value")
value_element.text = str(budget_item.amount)

if budget_item.value_date:
value_element.attrib['value-date'] = str(budget_item.value_date)

if budget_item.currency:
value_element.attrib['currency'] = budget_item.currency

if budget_item.other_extra:
value_element.attrib['{http://akvo.org/iati-activities}label'] = budget_item.\
other_extra
elif budget_item.label and budget_item.label.label:
value_element.attrib['{http://akvo.org/iati-activities}label'] = budget_item.label.\
label
if budget_item.value_date:
value_element.attrib['value-date'] = str(budget_item.value_date)

if budget_item.currency:
value_element.attrib['currency'] = budget_item.currency

akvo_label = '{http://akvo.org/iati-activities}label'
if budget_item.other_extra:
value_element.attrib[akvo_label] = budget_item.other_extra
elif budget_item.label and budget_item.label.label:
value_element.attrib[akvo_label] = budget_item.label.label

budget_elements.append(element)

Expand Down

0 comments on commit 7e61bec

Please sign in to comment.