10 lines
309 B
Python
10 lines
309 B
Python
from __future__ import annotations
|
|
|
|
from app.domain.users.entities import User
|
|
from app.domain.users.exceptions import UserAlreadyExists
|
|
|
|
|
|
def ensure_unique_email(*, existing_user: User | None) -> None:
|
|
if existing_user is not None:
|
|
raise UserAlreadyExists("User with this email already exists.")
|