Skip to content

Commit 984d532

Browse files
committed
Fixed errors in users.py
1 parent bc4cf98 commit 984d532

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/api/v1/users.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ async def patch_user(
8585
raise NotFoundException("User not found")
8686

8787
db_user = cast(UserRead, db_user)
88-
if db_user["username"] != current_user["username"]:
88+
if db_user.username != current_user["username"]:
8989
raise ForbiddenException()
9090

91-
if values.username != db_user["username"]:
91+
if values.username != db_user.username:
9292
existing_username = await crud_users.exists(db=db, username=values.username)
9393
if existing_username:
9494
raise DuplicateValueException("Username not available")
9595

96-
if values.email != db_user["email"]:
96+
if values.email != db_user.email:
9797
existing_email = await crud_users.exists(db=db, email=values.email)
9898
if existing_email:
9999
raise DuplicateValueException("Email is already registered")

0 commit comments

Comments
 (0)