Make cancel notifications optional

This commit is contained in:
Raphael Michel
2017-07-06 12:04:35 +02:00
parent d444935140
commit 21d432a3ca
3 changed files with 10 additions and 4 deletions

View File

@@ -732,10 +732,10 @@ def perform_order(self, event: str, payment_provider: str, positions: List[str],
@app.task(base=ProfiledTask, bind=True, max_retries=5, default_retry_delay=1, throws=(OrderError,))
def cancel_order(self, order: int, user: int=None):
def cancel_order(self, order: int, user: int=None, send_mail: bool=True):
try:
try:
return _cancel_order(order, user)
return _cancel_order(order, user, send_mail)
except LockTimeoutException:
self.retry(exc=OrderError(error_messages['busy']))
except (MaxRetriesExceededError, LockTimeoutException):