parameters: (self)
docstring: Registers users without OpenStreetMap account
          ---
          tags:
            - users
          produces:
            - application/json
          parameters:
              - in: body
                name: body
                required: true
                description: JSON object to update a user
                schema:
                    properties:
                        email:
                            type: string
                            example: test@test.com
          responses:
              200:
                  description: User registered
              400:
                  description: Client Error - Invalid Request
              500:
                  description: Internal Server Error
docstring_summary: Registers users without OpenStreetMap account
          ---
          tags:
            - users
          produces:
            - application/json
          parameters:
              - in: body
                name: body
                required: true
                description: JSON object to update a user
                schema:
                    properties:
                        email:
                            type: string
                            example: test
docstring_tokens: Registers users without OpenStreetMap account --- tags : - users produces : - application / json parameters : - in : body name : body required : true description : JSON object to update a user schema : properties : email : type : string example : test
function: def post(self):
          """
          Registers users without OpenStreetMap account
          ---
          tags:
            - users
          produces:
            - application/json
          parameters:
              - in: body
                name: body
                required: true
                description: JSON object to update a user
                schema:
                    properties:
                        email:
                            type: string
                            example: test@test.com
          responses:
              200:
                  description: User registered
              400:
                  description: Client Error - Invalid Request
              500:
                  description: Internal Server Error
          """
          try:
              user_dto = UserRegisterEmailDTO(request.get_json())
              user_dto.validate()
          except DataError as e:
              current_app.logger.error(f"error validating request: {str(e)}")
              return str(e), 400
  
          try:
              user = UserService.register_user_with_email(user_dto)
              user_dto = UserRegisterEmailDTO(
                  dict(
                      success=True,
                      email=user_dto.email,
                      details="User created successfully",
                      id=user.id,
                  )
              )
              return user_dto.to_primitive(), 200
          except ValueError as e:
              user_dto = UserRegisterEmailDTO(dict(email=user_dto.email, details=str(e)))
              return user_dto.to_primitive(), 400
          except Exception as e:
              details_msg = "User POST - unhandled error: Unknown error"
              current_app.logger.critical(str(e))
              user_dto = UserRegisterEmailDTO(
                  dict(email=user_dto.email, details=details_msg)
              )
              return user_dto.to_primitive(), 500
function_tokens: def post ( self ) : try : user_dto = UserRegisterEmailDTO ( request . get_json ( ) ) user_dto . validate ( ) except DataError as e : current_app . logger . error ( f"error validating request: {str(e)}" ) return str ( e ) , 400 try : user = UserService . register_user_with_email ( user_dto ) user_dto = UserRegisterEmailDTO ( dict ( success = True , email = user_dto . email , details = "User created successfully" , id = user . id , ) ) return user_dto . to_primitive ( ) , 200 except ValueError as e : user_dto = UserRegisterEmailDTO ( dict ( email = user_dto . email , details = str ( e ) ) ) return user_dto . to_primitive ( ) , 400 except Exception as e : details_msg = "User POST - unhandled error: Unknown error" current_app . logger . critical ( str ( e ) ) user_dto = UserRegisterEmailDTO ( dict ( email = user_dto . email , details = details_msg ) ) return user_dto . to_primitive ( ) , 500