Co-Authored-By: Classic298 <27028174+Classic298@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2026-06-29 06:08:31 -05:00
co-authored by Classic298
parent a285a390c1
commit eb53281c9a
2 changed files with 20 additions and 5 deletions
+10
View File
@@ -279,6 +279,11 @@ class UsersTable:
oauth: dict | None = None,
db: AsyncSession | None = None,
) -> UserModel | None:
try:
profile_image_url = validate_profile_image_url(profile_image_url)
except ValueError:
profile_image_url = '/user.png'
async with get_async_db_context(db) as session:
user = UserModel(
**{
@@ -606,6 +611,11 @@ class UsersTable:
profile_image_url: str,
db: AsyncSession | None = None,
) -> UserModel | None:
try:
profile_image_url = validate_profile_image_url(profile_image_url)
except ValueError:
profile_image_url = '/user.png'
async with get_async_db_context(db) as session:
user = await session.get(User, id)
if user is None: