Mercurial > kallithea
comparison rhodecode/model/user.py @ 1518:5585609772d0
merge beta fixes into stable
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 07 Oct 2011 17:54:21 +0200 |
parents | bf263968da47 582686d76cb6 |
children | 95c3e33ef32e |
comparison
equal
deleted
inserted
replaced
1515:da8f1d1b22de | 1518:5585609772d0 |
---|---|
26 import logging | 26 import logging |
27 import traceback | 27 import traceback |
28 | 28 |
29 from pylons.i18n.translation import _ | 29 from pylons.i18n.translation import _ |
30 | 30 |
31 from rhodecode.lib import safe_unicode | |
31 from rhodecode.model import BaseModel | 32 from rhodecode.model import BaseModel |
32 from rhodecode.model.caching_query import FromCache | 33 from rhodecode.model.caching_query import FromCache |
33 from rhodecode.model.db import User, RepoToPerm, Repository, Permission, \ | 34 from rhodecode.model.db import User, RepoToPerm, Repository, Permission, \ |
34 UserToPerm, UsersGroupRepoToPerm, UsersGroupToPerm, UsersGroupMember | 35 UserToPerm, UsersGroupRepoToPerm, UsersGroupToPerm, UsersGroupMember |
35 from rhodecode.lib.exceptions import DefaultUserException, \ | 36 from rhodecode.lib.exceptions import DefaultUserException, \ |
109 new_user.username = username.lower() | 110 new_user.username = username.lower() |
110 new_user.password = get_crypt_password(password) | 111 new_user.password = get_crypt_password(password) |
111 new_user.api_key = generate_api_key(username) | 112 new_user.api_key = generate_api_key(username) |
112 new_user.email = attrs['email'] | 113 new_user.email = attrs['email'] |
113 new_user.active = True | 114 new_user.active = True |
114 new_user.ldap_dn = user_dn | 115 new_user.ldap_dn = safe_unicode(user_dn) |
115 new_user.name = attrs['name'] | 116 new_user.name = attrs['name'] |
116 new_user.lastname = attrs['lastname'] | 117 new_user.lastname = attrs['lastname'] |
117 | 118 |
118 self.sa.add(new_user) | 119 self.sa.add(new_user) |
119 self.sa.commit() | 120 self.sa.commit() |