Pydantic was causing validation errors when passportID was an int
This commit is contained in:
@@ -55,7 +55,11 @@ class BatchUsers:
|
||||
|
||||
@staticmethod
|
||||
def _map_to_batch(request_data: Dict) -> BatchUsersDTO:
|
||||
users: list[UserDTO] = [UserDTO(**user) for user in request_data["users"]]
|
||||
users_list = [{**user} for user in request_data["users"]]
|
||||
for user in users_list:
|
||||
user["studentID"] = str(user["studentID"])
|
||||
|
||||
users: list[UserDTO] = [UserDTO(**user) for user in users_list]
|
||||
return BatchUsersDTO(makerID=request_data["makerID"], users=users)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user