hotpocket/services/backend/hotpocket_backend/apps/ui/services/saves.py
Tomek Wójcik b4338e2769
Some checks failed
CI / Checks (push) Failing after 13m2s
Release v1.0.0
2025-08-20 21:00:50 +02:00

27 lines
647 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
import logging
import uuid
from django.http import Http404
from hotpocket_soa.dto.saves import SaveOut
from hotpocket_soa.services import SavesService
LOGGER = logging.getLogger(__name__)
class UISavesService:
def __init__(self):
self.saves_service = SavesService()
def get_or_404(self, *, pk: uuid.UUID) -> SaveOut:
try:
return SavesService().get(pk=pk)
except SavesService.SaveNotFound as exception:
LOGGER.error(
'Save not found: pk=`%s`', pk, exc_info=exception,
)
raise Http404()