diff options
| author | Tom Christie | 2013-02-04 20:37:09 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-02-04 20:37:09 +0000 |
| commit | 8e846bdf52f03d0733ac73e418152800e582b898 (patch) | |
| tree | cd7034d5573f1e264798a618c88addc4d2f45ce0 /rest_framework/authtoken/models.py | |
| parent | d9b73e15c87c3a7f11d6bea5ffd6118f86e40051 (diff) | |
| parent | 97f2b994951605ffdef08159be450d1e77762bf9 (diff) | |
| download | django-rest-framework-8e846bdf52f03d0733ac73e418152800e582b898.tar.bz2 | |
Merge branch 'py3k' into 2.2
Conflicts:
rest_framework/relations.py
rest_framework/serializers.py
rest_framework/tests/relations_hyperlink.py
rest_framework/tests/relations_slug.py
Diffstat (limited to 'rest_framework/authtoken/models.py')
| -rw-r--r-- | rest_framework/authtoken/models.py | 4 |
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 |
