Skip to content

Commit 054ff0c

Browse files
authored
Fix the httpurl type compatibility with postgresql (#877)
* Fix the httpurl type compatibility with postgresql * Add noqa comments
1 parent 4f898a0 commit 054ff0c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/app/admin/crud/crud_user.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ async def add_by_oauth2(self, db: AsyncSession, obj: AddOAuth2UserParam) -> None
8787
:param obj: 注册用户参数
8888
:return:
8989
"""
90+
obj.avatar = str(obj.avatar) # noqa: fix pgsql compatibility
9091
dict_obj = obj.model_dump()
9192
dict_obj.update({'is_staff': True, 'salt': None})
9293
new_user = self.model(**dict_obj)
@@ -108,6 +109,8 @@ async def update(self, db: AsyncSession, input_user: User, obj: UpdateUserParam)
108109
"""
109110
role_ids = obj.roles
110111
del obj.roles
112+
113+
obj.avatar = str(obj.avatar) # noqa: fix pgsql compatibility
111114
count = await self.update_model(db, input_user.id, obj)
112115

113116
stmt = select(Role).where(Role.id.in_(role_ids))

0 commit comments

Comments
 (0)