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]
|
||||
hash = get_hexdigest(algo, salt, raw_password)
|
||||
self.password = '%s$%s$%s' % (algo, salt, hash)
|
||||
self.save()
|
||||
return self
|
||||
|
||||
def check_password(self, raw_password):
|
||||
"""Checks the user's password against a provided password - always use
|
||||
@ -73,6 +75,9 @@ class User(Document):
|
||||
user.save()
|
||||
return user
|
||||
|
||||
def get_and_delete_messages(self):
|
||||
return []
|
||||
|
||||
|
||||
class MongoEngineBackend(object):
|
||||
"""Authenticate using MongoEngine and mongoengine.django.auth.User.
|
||||
|
Loading…
x
Reference in New Issue
Block a user