              if (data_dict['password1'] and data_dict['password2']) \
                      or email_changed:
                  identity = {'login': c.user,
-@@ -385,6 +388,9 @@ class UserController(base.BaseController):
+@@ -385,6 +394,9 @@ class UserController(base.BaseController):
              errors = {'oldpassword': [_('Password entered was incorrect')]}
              error_summary = {_('Old Password'): _('incorrect password')}
              return self.edit(id, data_dict, errors, error_summary)

 import ckan.plugins as p
 
 from ckan.common import _, c, g, request, response
@@ -350,6 +351,8 @@ class UserController(base.BaseController):
 
             email_changed = data_dict['email'] != c.userobj.email
 

                 if not to_preview:
                     redirect(h.url_for(controller='package',
diff --git a/ckan/controllers/user.py b/ckan/controllers/user.py
index ebc305d..45245c3 100644
--- a/ckan/controllers/user.py
+++ b/ckan/controllers/user.py
@@ -16,6 +16,7 @@ import ckan.lib.captcha as captcha
