From 88e291a6ed830f11671f04893031eec2291a6703 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 1 Oct 2015 00:51:31 +0300 Subject: POI.created_by is null=True --- servo/models/purchases.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'servo/models') diff --git a/servo/models/purchases.py b/servo/models/purchases.py index 3a59a9b..d32c936 100644 --- a/servo/models/purchases.py +++ b/servo/models/purchases.py @@ -295,7 +295,8 @@ class PurchaseOrderItem(AbstractOrderItem): self.purchase_order_ref = self.purchase_order.reference if self.user_fullname == '': - self.user_fullname = self.created_by.get_name() + user = self.created_by or self.purchase_order.created_by + self.user_fullname = user.get_name() super(PurchaseOrderItem, self).save(*args, **kwargs) -- cgit v1.2.3