mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
Fix the httpurl type compatibility with postgresql (#877)
* Fix the httpurl type compatibility with postgresql * Add noqa comments
This commit is contained in:
@@ -87,6 +87,7 @@ class CRUDUser(CRUDPlus[User]):
|
||||
:param obj: 注册用户参数
|
||||
:return:
|
||||
"""
|
||||
obj.avatar = str(obj.avatar) # noqa: fix pgsql compatibility
|
||||
dict_obj = obj.model_dump()
|
||||
dict_obj.update({'is_staff': True, 'salt': None})
|
||||
new_user = self.model(**dict_obj)
|
||||
@@ -108,6 +109,8 @@ class CRUDUser(CRUDPlus[User]):
|
||||
"""
|
||||
role_ids = obj.roles
|
||||
del obj.roles
|
||||
|
||||
obj.avatar = str(obj.avatar) # noqa: fix pgsql compatibility
|
||||
count = await self.update_model(db, input_user.id, obj)
|
||||
|
||||
stmt = select(Role).where(Role.id.in_(role_ids))
|
||||
|
||||
Reference in New Issue
Block a user