From 90eb279008f2e555fede9c2d73ac79765a048e4f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 22 Feb 2022 11:31:11 +0100 Subject: [PATCH] fix get_or_create_user --- ereuse_devicehub/inventory/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 521487ee..8d0107b0 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -736,7 +736,7 @@ class TradeForm(NewActionForm): # Create receiver (to) phantom account if user_from and not user_to: assert g.user.email == user_from - user = self.create_user(code) + user = self.get_or_create_user(code) self.user_from = g.user self.user_to = user return @@ -744,7 +744,7 @@ class TradeForm(NewActionForm): # Create supplier (from) phantom account if not user_from and user_to: assert g.user.email == user_to - user = self.create_user(code) + user = self.get_or_create_user(code) self.user_from = user self.user_to = g.user