-
Notifications
You must be signed in to change notification settings - Fork 44.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
12 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,19 +37,17 @@ async def get_user_by_id(user_id: str) -> Optional[User]: | |
return User.model_validate(user) if user else None | ||
|
||
|
||
async def create_default_user(enable_auth: bool) -> Optional[User]: | ||
if enable_auth: | ||
user = await prisma.user.find_unique(where={"id": DEFAULT_USER_ID}) | ||
if not user: | ||
user = await prisma.user.create( | ||
data={ | ||
"id": DEFAULT_USER_ID, | ||
"email": "[email protected]", | ||
"name": "Default User", | ||
} | ||
) | ||
return User.model_validate(user) | ||
return None | ||
async def create_default_user() -> Optional[User]: | ||
user = await prisma.user.find_unique(where={"id": DEFAULT_USER_ID}) | ||
if not user: | ||
user = await prisma.user.create( | ||
data={ | ||
"id": DEFAULT_USER_ID, | ||
"email": "[email protected]", | ||
"name": "Default User", | ||
} | ||
) | ||
return User.model_validate(user) | ||
|
||
|
||
async def get_user_metadata(user_id: str) -> UserMetadataRaw: | ||
|
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