Skip to content

Commit 96ed21b

Browse files
author
pietro convalle
committed
fixed error detail string
1 parent aa9f983 commit 96ed21b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

answerking_app/utils/mixins/IntegrityHandlerMixins.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def update(self, request: Request, *args, **kwargs) -> Response:
2828

2929
def handle_IntegrityError(exc: IntegrityError) -> NoReturn:
3030
if exc.args[0] == DUP_ENTRY:
31-
raise HttpErrorResponse(status=status.HTTP_400_BAD_REQUEST)
31+
raise HttpErrorResponse(
32+
status=status.HTTP_400_BAD_REQUEST,
33+
detail="This name already exists",
34+
)
3235
else:
3336
raise HttpErrorResponse(status=status.HTTP_500_INTERNAL_SERVER_ERROR)

0 commit comments

Comments
 (0)