Remove reliance on binascii for converting binary to hex

This commit is contained in:
Hugo Cartwright 2021-04-05 12:13:31 +02:00
parent 51169060b6
commit a5e189c761

View File

@ -1,4 +1,3 @@
import binascii
import os
from django.conf import settings
@ -34,7 +33,7 @@ class Token(models.Model):
@classmethod
def generate_key(cls):
return binascii.hexlify(os.urandom(20)).decode()
return (os.urandom(20)).hex()
def __str__(self):
return self.key