-
-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/improve user feedback (#1076)
* add proper type annotations * fix state management and dead code * add response messages
- Loading branch information
Showing
4 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from fastapi import HTTPException, status | ||
from pydantic import UUID4 | ||
|
||
from mealie.schema.user.user import PrivateUser | ||
|
||
|
||
def assert_user_change_allowed(id: int, current_user: PrivateUser): | ||
def assert_user_change_allowed(id: UUID4, current_user: PrivateUser): | ||
if current_user.id != id and not current_user.admin: | ||
# only admins can edit other users | ||
raise HTTPException(status.HTTP_403_FORBIDDEN, detail="NOT_AN_ADMIN") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters