aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/model/user.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-07-04 18:13:25 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-07-04 18:13:25 +0200
commitb3002dceb43a5cbdcaa2ad50fa128a4336ce9876 (patch)
treedba58824fade9176db812501b3ec1b836f58182b /rhodecode/model/user.py
parent3298c16d2249096bf1709d4b040af6eabdf2deb2 (diff)
Renamed name to firstname in forms
- added multiple test for edit my account and edit user from admin - fixed issues with update user accounts from admin --HG-- branch : beta
Diffstat (limited to 'rhodecode/model/user.py')
-rw-r--r--rhodecode/model/user.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py
index ce84fa25..d9c98bea 100644
--- a/rhodecode/model/user.py
+++ b/rhodecode/model/user.py
@@ -96,6 +96,8 @@ class UserModel(BaseModel):
for k, v in form_data.items():
if k == 'password':
v = get_crypt_password(v)
+ if k == 'firstname':
+ k = 'name'
setattr(new_user, k, v)
new_user.api_key = generate_api_key(form_data['username'])
@@ -264,12 +266,13 @@ class UserModel(BaseModel):
" crucial for entire application"))
for k, v in form_data.items():
- if k == 'new_password' and v != '':
+ 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'
setattr(user, k, v)
-
self.sa.add(user)
except:
log.error(traceback.format_exc())
@@ -285,10 +288,12 @@ class UserModel(BaseModel):
" crucial for entire application")
)
for k, v in form_data.items():
- if k == 'new_password' and v != '':
+ 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)