set_password returns user object, comp. with django 1.2
This commit is contained in:
parent
3762a69537
commit
bc7e6ccf53
@ -53,6 +53,8 @@ class User(Document):
|
|||||||
salt = get_hexdigest(algo, str(random()), str(random()))[:5]
|
salt = get_hexdigest(algo, str(random()), str(random()))[:5]
|
||||||
hash = get_hexdigest(algo, salt, raw_password)
|
hash = get_hexdigest(algo, salt, raw_password)
|
||||||
self.password = '%s$%s$%s' % (algo, salt, hash)
|
self.password = '%s$%s$%s' % (algo, salt, hash)
|
||||||
|
self.save()
|
||||||
|
return self
|
||||||
|
|
||||||
def check_password(self, raw_password):
|
def check_password(self, raw_password):
|
||||||
"""Checks the user's password against a provided password - always use
|
"""Checks the user's password against a provided password - always use
|
||||||
@ -72,6 +74,9 @@ class User(Document):
|
|||||||
user.set_password(password)
|
user.set_password(password)
|
||||||
user.save()
|
user.save()
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
def get_and_delete_messages(self):
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
class MongoEngineBackend(object):
|
class MongoEngineBackend(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user