Skip to content

Commit

Permalink
Added raw_mode response for entry (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubydog authored Jun 15, 2021
1 parent 7887c61 commit fafee45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG

## Unreleased
* Fixed a bug to retrieve an entry when raw_mode is enabled.

## v1.13.0
### Added
Expand Down
8 changes: 6 additions & 2 deletions contentful/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ def entry(self, entry_id, query=None):

try:
query.update({'sys.id': entry_id})
return self._get(
response = self._get(
self.environment_url('/entries'),
query
)[0]
)

if self.raw_mode:
return response
return response[0]
except IndexError:
raise EntryNotFoundError(
"Entry not found for ID: '{0}'".format(entry_id)
Expand Down

0 comments on commit fafee45

Please sign in to comment.