#355 API - Fix how to munchify the response
Merged 5 years ago by clime. Opened 5 years ago by frostyx.
copr/ frostyx/copr apiv3-fix-munchify  into  master

@@ -1,6 +1,6 @@ 

  import os

  from ..helpers import config_from_file

- from ..requests import Request

+ from ..requests import Request, munchify

  

  

  class BaseProxy(object):
@@ -33,7 +33,7 @@ 

          endpoint = ""

          request = Request(endpoint, api_base_url=self.api_base_url)

          response = request.send()

-         return response.munchify()

+         return munchify(response)

  

      def auth_check(self):

          """
@@ -44,4 +44,4 @@ 

          endpoint = "/auth-check"

          request = Request(endpoint, api_base_url=self.api_base_url, auth=self.auth)

          response = request.send()

-         return response.munchify()

+         return munchify(response)

When we removed the own Response class in the 69e84c5, the munchify became a standalone function instead of its method.
I've updated the usage in all proxies, but I forgot to update the BaseProxy. This PR fixes it.

Pull-Request has been merged by clime

5 years ago
Metadata