diff -r 679ec82798e9 roundup/cgi/actions.py --- a/roundup/cgi/actions.py Wed Aug 18 21:00:11 2021 -0400 +++ b/roundup/cgi/actions.py Thu Aug 19 10:31:08 2021 -0400 @@ -1354,6 +1354,14 @@ # If we came from someplace, go back there if '__came_from' in self.form: + query['@ok_message'] = _("Welcome %(username)s!") %{"username" : self.client.user, } # adds welcome message to user when logged in + redirect_url = urllib_.urlunparse((redirect_url_tuple.scheme, + redirect_url_tuple.netloc, + redirect_url_tuple.path, + redirect_url_tuple.params, + urllib_.urlencode(list(sorted(query.items())), doseq=True), + redirect_url_tuple.fragment)) + raise exceptions.Redirect(redirect_url) def verifyLogin(self, username, password): diff -r 679ec82798e9 test/test_actions.py --- a/test/test_actions.py Wed Aug 18 21:00:11 2021 -0400 +++ b/test/test_actions.py Thu Aug 19 10:31:08 2021 -0400 @@ -368,22 +368,22 @@ self.client.opendb = opendb # basic test with query - self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search", + self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40ok_message=Welcome+foo%21", 'foo', 'right', "http://whoami.com/path/issue?@action=search") # test that old messages are removed self.form.value[:] = [] # clear out last test's setup values - self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search", + self.assertLoginRaisesRedirect("http://whoami.com/path/issue?%40action=search&%40ok_message=Welcome+foo%21", 'foo', 'right', "http://whoami.com/path/issue?@action=search&@ok_messagehurrah+we+win&@error_message=blam") # test when there is no query self.form.value[:] = [] # clear out last test's setup values - self.assertLoginRaisesRedirect("http://whoami.com/path/issue255", + self.assertLoginRaisesRedirect("http://whoami.com/path/issue255?%40ok_message=Welcome+foo%21", 'foo', 'right', "http://whoami.com/path/issue255") # test if we are logged out; should kill the @action=logout self.form.value[:] = [] # clear out last test's setup values - self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40pagesize=50&%40startwith=0", + self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40ok_message=Welcome+foo%21&%40pagesize=50&%40startwith=0", 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0") def testInvalidLoginRedirect(self):