mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 20:55:10 +01:00
Fix for Python 3 and encoding
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import binascii
|
||||
import datetime
|
||||
import gzip
|
||||
import hashlib
|
||||
@@ -232,7 +233,7 @@ class User(BaseModel):
|
||||
|
||||
def generate_key(self):
|
||||
""" Generate userkey """
|
||||
self.key = os.urandom(24).encode('hex')
|
||||
self.key = binascii.hexlify(os.urandom(24))
|
||||
return self.key
|
||||
|
||||
|
||||
@@ -439,7 +440,7 @@ class PublicTag(BaseModel):
|
||||
|
||||
def generate_key(self):
|
||||
""" Generate hash-based key for publicly shared tag """
|
||||
self.tagkey = os.urandom(16).encode('hex')
|
||||
self.tagkey = binascii.hexlify(os.urandom(16))
|
||||
|
||||
|
||||
def get_tags_for_user(userkey):
|
||||
|
||||
Reference in New Issue
Block a user