mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-12 14:38:58 +00:00
Update models.py
This commit is contained in:
parent
04f948f7e4
commit
2be71dd00b
@ -122,7 +122,7 @@ class RegistrationManager(models.Manager):
|
|||||||
if isinstance(username, str):
|
if isinstance(username, str):
|
||||||
username = username.encode('utf-8')
|
username = username.encode('utf-8')
|
||||||
|
|
||||||
# Take the first 16 character to avoid errors.
|
# Take the first 40 character to avoid errors.
|
||||||
# (1406, "Data too long for column 'activation_key' at row 1")
|
# (1406, "Data too long for column 'activation_key' at row 1")
|
||||||
activation_key = hashlib.sha256(salt+username).hexdigest()[:40]
|
activation_key = hashlib.sha256(salt+username).hexdigest()[:40]
|
||||||
return self.create(emailuser_id=user.id,
|
return self.create(emailuser_id=user.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user