Skip to content

Commit eb91a6e

Browse files
committed
email in model [email_in_model]
1 parent a65d544 commit eb91a6e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/allocation/model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from datetime import date
44
from typing import Optional, List, Set
55
from allocation import exceptions
6+
from allocation import email
67

78

89
class Product:
@@ -21,6 +22,7 @@ def allocate(self, line: OrderLine) -> str:
2122
self.version_number += 1
2223
return batch.reference
2324
except StopIteration:
25+
email.send_mail('[email protected]', f'Out of stock for {line.sku}')
2426
raise exceptions.OutOfStock(f'Out of stock for sku {line.sku}')
2527

2628

0 commit comments

Comments
 (0)