set_password returns user object, comp. with django 1.2
This commit is contained in:
		| @@ -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 | ||||||
| @@ -73,6 +75,9 @@ class User(Document): | |||||||
|         user.save() |         user.save() | ||||||
|         return user |         return user | ||||||
|      |      | ||||||
|  |     def get_and_delete_messages(self): | ||||||
|  |         return [] | ||||||
|  |  | ||||||
|  |  | ||||||
| class MongoEngineBackend(object): | class MongoEngineBackend(object): | ||||||
|     """Authenticate using MongoEngine and mongoengine.django.auth.User. |     """Authenticate using MongoEngine and mongoengine.django.auth.User. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user