Show More
@@ -98,7 +98,10 b' class UsersController(BaseController):' | |||
|
98 | 98 | # method='put') |
|
99 | 99 | # url('user', id=ID) |
|
100 | 100 | user_model = UserModel() |
|
101 | _form = UserForm(edit=True, old_data={'user_id':id})() | |
|
101 | c.user = user_model.get_user(id) | |
|
102 | ||
|
103 | _form = UserForm(edit=True, old_data={'user_id':id, | |
|
104 | 'email':c.user.email})() | |
|
102 | 105 | form_result = {} |
|
103 | 106 | try: |
|
104 | 107 | form_result = _form.to_python(dict(request.POST)) |
@@ -106,7 +109,6 b' class UsersController(BaseController):' | |||
|
106 | 109 | h.flash(_('User updated succesfully'), category='success') |
|
107 | 110 | |
|
108 | 111 | except formencode.Invalid as errors: |
|
109 | c.user = user_model.get_user(id) | |
|
110 | 112 | return htmlfill.render( |
|
111 | 113 | render('admin/users/user_edit.html'), |
|
112 | 114 | defaults=errors.value, |
@@ -212,7 +212,7 b' class ValidPath(formencode.validators.Fa' | |||
|
212 | 212 | def UniqSystemEmail(old_data): |
|
213 | 213 | class _UniqSystemEmail(formencode.validators.FancyValidator): |
|
214 | 214 | def to_python(self, value, state): |
|
215 |
if old_data |
|
|
215 | if old_data.get('email') != value: | |
|
216 | 216 | sa = meta.Session |
|
217 | 217 | try: |
|
218 | 218 | user = sa.query(User).filter(User.email == value).scalar() |
General Comments 0
You need to be logged in to leave comments.
Login now