Skip to content

Commit

Permalink
Merge pull request #1429 from okfn/1429-language-reset-after-register
Browse files Browse the repository at this point in the history
UI language reset after account creation
  • Loading branch information
nigelbabu committed Jan 28, 2014
2 parents dfb107e + cd648de commit ed063f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ckan/controllers/user.py
Expand Up @@ -220,10 +220,17 @@ def _save_new(self, context):
# Redirect to a URL picked up by repoze.who which performs the
# login
login_url = self._get_repoze_handler('login_handler_path')
h.redirect_to('%s?login=%s&password=%s' % (

# We need to pass the logged in URL as came_from parameter
# otherwise we lose the language setting
came_from = h.url_for(controller='user', action='logged_in',
__ckan_no_root=True)
redirect_url = '{0}?login={1}&password={2}&came_from={3}'
h.redirect_to(redirect_url.format(
login_url,
str(data_dict['name']),
quote(data_dict['password1'].encode('utf-8'))))
quote(data_dict['password1'].encode('utf-8')),
came_from))
else:
# #1799 User has managed to register whilst logged in - warn user
# they are not re-logged in as new user.
Expand Down

0 comments on commit ed063f1

Please sign in to comment.