diff --git a/ereuse_devicehub/resources/action/views/trade.py b/ereuse_devicehub/resources/action/views/trade.py index d5aa3d96..7b92673c 100644 --- a/ereuse_devicehub/resources/action/views/trade.py +++ b/ereuse_devicehub/resources/action/views/trade.py @@ -58,7 +58,9 @@ class TradeView(): # check than the user than want to do the action is one of the users # involved in the action - assert g.user in [self.trade.user_from, self.trade.user_to] + if not g.user in [self.trade.user_from, self.trade.user_to]: + txt = "You do not participate in this trading" + raise ValidationError(txt) confirm_from = Confirm(user=self.trade.user_from, action=self.trade,