1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-27 11:01:14 +00:00

Update models.py

This commit is contained in:
r350178982 2025-04-08 17:05:48 +08:00
parent 04f948f7e4
commit 2be71dd00b

View File

@ -122,7 +122,7 @@ class RegistrationManager(models.Manager):
if isinstance(username, str):
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")
activation_key = hashlib.sha256(salt+username).hexdigest()[:40]
return self.create(emailuser_id=user.id,