diff rhodecode/model/user.py @ 3159:4910b2607a29 beta

fixes issue #658, my account edit was missing this functionality
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 10 Jan 2013 23:09:17 +0100
parents c5169e445fb8
children cd50d1b5f35b 5c310b7b01ce
line wrap: on
line diff
--- a/rhodecode/model/user.py	Thu Jan 10 20:39:22 2013 +0100
+++ b/rhodecode/model/user.py	Thu Jan 10 23:09:17 2013 +0100
@@ -293,30 +293,6 @@
             log.error(traceback.format_exc())
             raise
 
-    def update_my_account(self, user_id, form_data):
-        from rhodecode.lib.auth import get_crypt_password
-        try:
-            user = self.get(user_id, cache=False)
-            if user.username == 'default':
-                raise DefaultUserException(
-                    _("You can't Edit this user since it's"
-                      " crucial for entire application")
-                )
-            for k, v in form_data.items():
-                if k == 'new_password' and v:
-                    user.password = get_crypt_password(v)
-                    user.api_key = generate_api_key(user.username)
-                else:
-                    if k == 'firstname':
-                        k = 'name'
-                    if k not in ['admin', 'active']:
-                        setattr(user, k, v)
-
-            self.sa.add(user)
-        except:
-            log.error(traceback.format_exc())
-            raise
-
     def delete(self, user):
         user = self._get_user(user)