aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authtoken/models.py
diff options
context:
space:
mode:
authorTom Christie2013-02-06 00:53:41 -0800
committerTom Christie2013-02-06 00:53:41 -0800
commit72fe686623f63b79fa2b7f7de177c6d98bc1da3f (patch)
tree5d0834d4eb2caf21ed54a4dcba9a4a3a40e6fa99 /rest_framework/authtoken/models.py
parent221e77d3575c182eb49d50546f844f392a5f7ba6 (diff)
parentbdc97c561147130b59c8cd8cc6bc735eab8b223d (diff)
downloaddjango-rest-framework-72fe686623f63b79fa2b7f7de177c6d98bc1da3f.tar.bz2
Merge pull request #636 from tomchristie/2.2
2.2 Release
Diffstat (limited to 'rest_framework/authtoken/models.py')
-rw-r--r--rest_framework/authtoken/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/authtoken/models.py b/rest_framework/authtoken/models.py
index 4da2aa62..7f5a75a3 100644
--- a/rest_framework/authtoken/models.py
+++ b/rest_framework/authtoken/models.py
@@ -19,8 +19,8 @@ class Token(models.Model):
return super(Token, self).save(*args, **kwargs)
def generate_key(self):
- unique = str(uuid.uuid4())
- return hmac.new(unique, digestmod=sha1).hexdigest()
+ unique = uuid.uuid4()
+ return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
def __unicode__(self):
return self.key