From dfe3b76d367fcf7a166d5eedf75829c91d2e9833 Mon Sep 17 00:00:00 2001 From: Micky Aarnoudse <38373682+turtle-94@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:38:31 +0100 Subject: [PATCH] add email to order mapper (#17) --- oscar_odin/mappings/order.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oscar_odin/mappings/order.py b/oscar_odin/mappings/order.py index 2cdd2be..56ae3f6 100644 --- a/oscar_odin/mappings/order.py +++ b/oscar_odin/mappings/order.py @@ -103,6 +103,11 @@ class OrderToResource(odin.Mapping): from_obj = OrderModel to_obj = resources.order.Order + @odin.assign_field + def email(self) -> str: + """Map order email.""" + return self.source.email + @odin.assign_field def user(self) -> Optional[resources.auth.User]: """Map user."""