This commit is contained in:
2025-03-19 13:00:24 +08:00
parent c81b5b1a55
commit b3f7112117

View File

@@ -8,7 +8,7 @@ from .models import User, RoleChoices
class UserListSchema(ModelSchema): class UserListSchema(ModelSchema):
@classmethod @classmethod
def get(cls, obj): def get(cls, obj):
raw_password = obj.raw_password if obj.role == RoleChoices.NORMAL else "" raw_password = obj.raw_password if obj.role != RoleChoices.SUPER else ""
return cls( return cls(
id=obj.id, id=obj.id,
username=obj.username, username=obj.username,