add raise instead of assert

This commit is contained in:
Cayo Puigdefabregas 2021-06-02 13:46:28 +02:00
parent 20e029b359
commit 0c99a85361

View file

@ -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,