Skip to content
This repository has been archived by the owner. It is now read-only.

LOGGLY-1675, fix hmac raising TypeError #2

Merged
merged 1 commit into from Nov 16, 2012
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

LOGGLY-1675, fix hmac raising TypeError

  • Loading branch information
♥ Ivan Tam ♥
♥ Ivan Tam ♥ committed Nov 12, 2012
commit 371728041519a3a76fe05e4fca9a7169ea1bb49e
@@ -13,6 +13,11 @@ def __init__(self, oauth_request):
def lookup_consumer(self, key):
try:
self.consumer = Consumer.objects.get(key=key)

# LOGGLY-1675, Unicoded Consumers cause hmac.new() to raise TypeError
self.consumer.key = self.consumer.key.encode('ascii')
self.consumer.secret = self.consumer.secret.encode('ascii')

return self.consumer
except Consumer.DoesNotExist:
return None
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.