diff --git a/HISTORY.rst b/HISTORY.rst index cfad849..ab5e19c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ------- +3.0.5 (2014-04-24) +------------------ + +* Removed 'content-type' header from GET requests + 3.0.4 (2014-03-12) ------------------ diff --git a/eventbrite/__init__.py b/eventbrite/__init__.py index 95cdbe3..8d22a2f 100755 --- a/eventbrite/__init__.py +++ b/eventbrite/__init__.py @@ -3,7 +3,7 @@ __author__ = 'Daniel Greenfeld' __email__ = 'danny@eventbrite.com' -__version__ = '3.0.4' +__version__ = '3.0.5' from .client import Eventbrite diff --git a/eventbrite/client.py b/eventbrite/client.py index 5d1e92f..9ea832b 100755 --- a/eventbrite/client.py +++ b/eventbrite/client.py @@ -57,6 +57,7 @@ def api(self, method, path, data, expansions=()): @objectify def get(self, path, data=None, expansions=()): + self.content_type_specified = False path = format_path(path, self.eventbrite_api_url) return requests.get(path, headers=self.headers, params=data or {}) @@ -191,7 +192,6 @@ def post_event(self, data): def event_search(self, **data): # Resolves the search result response problem - self.content_type_specified = False return self.get("/events/search/", data=data) def webhook_to_object(self, webhook): diff --git a/eventbrite/models.py b/eventbrite/models.py index ccb1255..be4bca3 100644 --- a/eventbrite/models.py +++ b/eventbrite/models.py @@ -22,6 +22,7 @@ def create(cls, response): evbobject.headers = response.headers evbobject.reason = response.reason evbobject.status_code = response.status_code + evbobject.request = response.request api_data_type = reverse(evbobject.resource_uri) # TODO: figure out what to do with endpoint, which doesn't have defined serializer # TODO: solve issue with non-standard serializes not mapping directly to defined objects diff --git a/setup.py b/setup.py index cda9f91..ab3f04c 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from distutils.core import setup -__version__ = '3.0.4' +__version__ = '3.0.5' if sys.argv[-1] == 'tag': os.system("git tag -a %s -m 'version %s'" % (__version__, __version__)) diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 4dcc6b2..2f7dea5 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -48,6 +48,10 @@ def test_api_get(self): self.assertTrue(isinstance(payload.elapsed, timedelta)) self.assertTrue(isinstance(payload.headers, CaseInsensitiveDict)) + self.assertFalse( + 'content-type' in payload.request.headers + ) + @unittest.skipIf(condition=skip_integration_tests, reason='Needs an OAUTH_TOKEN') def test_api_post(self): pass # TODO