Resolve "evaluate uv"
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import hmac
|
||||
import random
|
||||
import string
|
||||
import hashlib
|
||||
@@ -29,7 +28,7 @@ class UserDAO:
|
||||
|
||||
def make_pw_hash(self, pw,salt=None):
|
||||
if salt == None:
|
||||
salt = self.make_salt();
|
||||
salt = self.make_salt()
|
||||
return hashlib.sha256(pw + salt).hexdigest()+","+ salt
|
||||
|
||||
# Validates a user login. Returns user record or None
|
||||
@@ -68,7 +67,7 @@ class UserDAO:
|
||||
except pymongo.errors.OperationFailure:
|
||||
print("oops, mongo error")
|
||||
return False
|
||||
except pymongo.errors.DuplicateKeyError as e:
|
||||
except pymongo.errors.DuplicateKeyError:
|
||||
print("oops, username is already taken")
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user