Skip to content

Commit 2be857b

Browse files
committed
Remove deprecated status codes
1 parent 7285ac8 commit 2be857b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

futuramaapi/routers/rest/users_new/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
status.HTTP_201_CREATED: {
4444
"model": CreateUserResponse,
4545
},
46-
status.HTTP_422_UNPROCESSABLE_ENTITY: {
46+
status.HTTP_422_UNPROCESSABLE_CONTENT: {
4747
"description": "User already exists.",
4848
},
4949
},

futuramaapi/routers/services/notifications/sse_character.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def __call__(self, request: Request, *args, **kwargs) -> EventSourceRespon
7676
character: CharacterModel = (await session.execute(self.statement)).scalars().one()
7777
except NoResultFound:
7878
raise HTTPException(
79-
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
79+
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
8080
detail=f"Character with id={self.pk} not found",
8181
) from None
8282

futuramaapi/routers/services/users/create_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def process(self, *args, **kwargs) -> CreateUserResponse:
126126
except exc.IntegrityError as err:
127127
if err.orig.sqlstate == UniqueViolationError.sqlstate:
128128
raise HTTPException(
129-
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
129+
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
130130
detail="User already exists.",
131131
) from None
132132
raise

0 commit comments

Comments
 (0)