Fix user chech in events patch endpoint

This commit is contained in:
Peter Vacho 2025-01-02 14:31:17 +01:00
parent d24e31af93
commit 828f4e4aec
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -360,7 +360,7 @@ async def partial_update_event(
detail="Event with given id doesn't exist", detail="Event with given id doesn't exist",
) )
if cast(User, event.user).id != user: if cast(User, event.user).id != user.id:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN, status_code=status.HTTP_403_FORBIDDEN,
detail="You can only access your own events", detail="You can only access your own events",