diff --git a/app/api/v1/schema/user.py b/app/api/v1/schema/user.py index 385e46d..fd82297 100644 --- a/app/api/v1/schema/user.py +++ b/app/api/v1/schema/user.py @@ -10,4 +10,4 @@ class UserInfoIn(Schema): class UserInfoOut(Schema): nickname = String() avatar_id = String() - height = Float() \ No newline at end of file + height = Float(allow_nan=True) \ No newline at end of file diff --git a/app/api/v1/user.py b/app/api/v1/user.py index 57d1767..c234e93 100644 --- a/app/api/v1/user.py +++ b/app/api/v1/user.py @@ -48,6 +48,8 @@ def get_user_info(): if user_dict: result.update(user_dict) if body_info_dict: - result['height'] = body_info_dict['height'] + result['height'] = body_info_dict.get('height', None) + else: + result['height'] = None return result