Skip to content

Commit 60ed42a

Browse files
committed
email in model [email_in_model]
1 parent 4aa165e commit 60ed42a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/allocation/domain/model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dataclasses import dataclass
33
from datetime import date
44
from typing import Optional, List, Set
5+
from allocation.adapters import email
56

67

78
class OutOfStock(Exception):
@@ -24,6 +25,7 @@ def allocate(self, line: OrderLine) -> str:
2425
self.version_number += 1
2526
return batch.reference
2627
except StopIteration:
28+
email.send_mail('stock@made.com', f'Out of stock for {line.sku}')
2729
raise OutOfStock(f'Out of stock for sku {line.sku}')
2830

2931

0 commit comments

Comments
 (0)