Skip to content

Commit

Permalink
Merge pull request #2 from pix0r/master
Browse files Browse the repository at this point in the history
Fix encoding issue in piston.store.DataStore.lookup_consumer
  • Loading branch information
glogiotatidis committed Mar 18, 2012
2 parents 3b81d3c + a840e32 commit 135b064
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions foo/piston/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def __init__(self, oauth_request):
def lookup_consumer(self, key):
try:
self.consumer = Consumer.objects.get(key=key)

# Fix encoding issue
# https://bitbucket.org/jespern/django-piston/issue/171/typeerror-character-mapping-must-return
self.consumer.key = self.consumer.key.encode('ascii')
self.consumer.secret = self.consumer.secret.encode('ascii')

return self.consumer
except Consumer.DoesNotExist:
return None
Expand Down

0 comments on commit 135b064

Please sign in to comment.