refactor
This commit is contained in:
@@ -53,10 +53,10 @@ def PlacementNotFound(placement_id: uuid.UUID | None = None) -> HTTPException:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'Placement {placement_id} not found')
|
||||
|
||||
|
||||
def PublicationNotFound(publication_id: uuid.UUID | None = None) -> HTTPException:
|
||||
if publication_id is None:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, 'Publication not found')
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'Publication {publication_id} not found')
|
||||
def PlacementPostNotFound(placement_post_id: uuid.UUID | None = None) -> HTTPException:
|
||||
if placement_post_id is None:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, 'PlacementPost not found')
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'PlacementPost {placement_post_id} not found')
|
||||
|
||||
|
||||
def ChannelAlreadyExists(telegram_id: int) -> HTTPException:
|
||||
@@ -90,7 +90,7 @@ def CreativeMediaTooLarge(max_bytes: int) -> HTTPException:
|
||||
def CreativeInUse(creative_id: uuid.UUID) -> HTTPException:
|
||||
return HTTPException(
|
||||
status.HTTP_400_BAD_REQUEST,
|
||||
f'Creative {creative_id} is used in active publications and cannot be deleted',
|
||||
f'Creative {creative_id} is used in active placement_posts and cannot be deleted',
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user