add raise instead of assert

This commit is contained in:
Cayo Puigdefabregas 2021-06-02 13:46:28 +02:00
parent 20e029b359
commit 0c99a85361
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ class TradeView():
# check than the user than want to do the action is one of the users # check than the user than want to do the action is one of the users
# involved in the action # 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, confirm_from = Confirm(user=self.trade.user_from,
action=self.trade, action=self.trade,