Skip to content

Commit

Permalink
fixup! ✨(backend) add owner email to order export
Browse files Browse the repository at this point in the history
  • Loading branch information
kernicPanel committed Dec 19, 2024
1 parent 1110e8d commit c8068b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/joanie/core/serializers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,8 @@ def get_credit_card_expiration_date(self, instance) -> str:
Return the expiration date of the credit card if available,
otherwise an empty string.
"""
if not instance.credit_card:
return ""
month = instance.credit_card.expiration_month
year = instance.credit_card.expiration_year
return f"{month}/{year}"
Expand All @@ -1470,7 +1472,7 @@ def get_installment_value(self, instance, index, field) -> str:
if field == "due_date":
return value.strftime("%d/%m/%Y %H:%M:%S")
return value
except (IndexError, KeyError):
except (IndexError, KeyError, TypeError):
return ""

def get_installment_due_date_1(self, instance) -> str:
Expand Down

0 comments on commit c8068b8

Please sign in to comment.