)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":27838,"name":"Vadym Markov","email":"vmarkov@mirantis.com","username":"vmarkov"},"change_message_id":"e6d5288561ca00816c7542eee68218e0bb4b9603","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f3abf701_d631f4a5","updated":"2022-03-13 07:05:26.000000000","message":"recheck","commit_id":"8441dd531ac4cd1ccfd8ec5c2299bd29e26a220b"},{"author":{"_account_id":29313,"name":"Vishal Manchanda","email":"manchandavishal143@gmail.com","username":"vishalmanchanda"},"change_message_id":"6b91cbcdf803f194ef0f47700836f95703f7af1a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"439d47a1_0eeaacd5","updated":"2022-03-17 04:16:09.000000000","message":"recheck","commit_id":"20d13757a714b1955be31f429ac59a8156fcf74b"}],"openstack_auth/tests/unit/test_auth.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"412218cbc02c43dfb8ce8d804612c427c78d9d70","unresolved":true,"context_lines":[{"line_number":1301,"context_line":"        original_redirect \u003d shortcuts.redirect"},{"line_number":1302,"context_line":"        mock_redirect \u003d mock.Mock()"},{"line_number":1303,"context_line":"        shortcuts.redirect \u003d mock_redirect"},{"line_number":1304,"context_line":"        mock_redirect.side_effect \u003d mock_redirect_return"},{"line_number":1305,"context_line":""},{"line_number":1306,"context_line":"        url \u003d reverse(\u0027login\u0027)"},{"line_number":1307,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3094fdf5_a85ca058","line":1304,"updated":"2022-02-22 13:53:53.000000000","message":"Could you use mock.patch instead of replacing shortcuts.redirect directly?\nOtherwise, shortcuts.redirect will not be recovered after the test (including the test failure).\n\n  with mock.patch(\u0027django.shortcuts.redirect\u0027, side_effect\u003dmock_redirect_return):\n      \u003ctests calling redirect()\u003e\n\n  \u003cmore assertions after tests\u003e","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"},{"author":{"_account_id":27838,"name":"Vadym Markov","email":"vmarkov@mirantis.com","username":"vmarkov"},"change_message_id":"01b3376b9a0dcab576b45b483bf662d4ba0360de","unresolved":false,"context_lines":[{"line_number":1301,"context_line":"        original_redirect \u003d shortcuts.redirect"},{"line_number":1302,"context_line":"        mock_redirect \u003d mock.Mock()"},{"line_number":1303,"context_line":"        shortcuts.redirect \u003d mock_redirect"},{"line_number":1304,"context_line":"        mock_redirect.side_effect \u003d mock_redirect_return"},{"line_number":1305,"context_line":""},{"line_number":1306,"context_line":"        url \u003d reverse(\u0027login\u0027)"},{"line_number":1307,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"e9f45c4f_30007e8c","line":1304,"in_reply_to":"3094fdf5_a85ca058","updated":"2022-03-12 16:57:44.000000000","message":"Updated","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"}],"openstack_auth/views.py":[{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"efb149f73057727be11ab239068e617c084d2acd","unresolved":true,"context_lines":[{"line_number":303,"context_line":"    try:"},{"line_number":304,"context_line":"        response \u003d shortcuts.redirect(redirect_to)"},{"line_number":305,"context_line":"    except NoReverseMatch:"},{"line_number":306,"context_line":"        response \u003d shortcuts.redirect(settings.LOGIN_REDIRECT_URL)"},{"line_number":307,"context_line":"    utils.set_response_cookie(response, \u0027recent_project\u0027,"},{"line_number":308,"context_line":"                              request.user.project_id)"},{"line_number":309,"context_line":"    return response"}],"source_content_type":"text/x-python","patch_set":1,"id":"6e584a79_d079c7c8","line":306,"updated":"2022-02-22 15:23:13.000000000","message":"The redirect_to is supposed to be an URL in this case, the fact that Django tries to resolve a view name if it doesn\u0027t look like an URL is unintended. Maybe it would be better to just create a HttpResponseRedirect directly here, always treating redirect_to as an URL?","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"71427907bd8a543cfbd5823628cdb4c3acc4712f","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    try:"},{"line_number":304,"context_line":"        response \u003d shortcuts.redirect(redirect_to)"},{"line_number":305,"context_line":"    except NoReverseMatch:"},{"line_number":306,"context_line":"        response \u003d shortcuts.redirect(settings.LOGIN_REDIRECT_URL)"},{"line_number":307,"context_line":"    utils.set_response_cookie(response, \u0027recent_project\u0027,"},{"line_number":308,"context_line":"                              request.user.project_id)"},{"line_number":309,"context_line":"    return response"}],"source_content_type":"text/x-python","patch_set":1,"id":"deacbd83_8c311e89","line":306,"in_reply_to":"080b49db_f7e7657d","updated":"2022-05-18 11:06:42.000000000","message":"The way shortcuts.redirect works, you can use it to either redirect to an url, or to a view name. The error can only happen with the latter case, when the view you reference doesn\u0027t exist — if you redirect to an url, it will always work. In this particular case, Horizon only ever redirects to an URL. So if we switched from using shortcuts.redirect to creating the HttpResponseRedirect oourselves here, we could avoid the error completely, because it only happens for a case that we don\u0027t use here anyways.\nHaving said that, I\u0027m perfectly fine with catching the error.","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"8d54f2c355c428a9f0735ead1d81cc40fb1bfa0e","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    try:"},{"line_number":304,"context_line":"        response \u003d shortcuts.redirect(redirect_to)"},{"line_number":305,"context_line":"    except NoReverseMatch:"},{"line_number":306,"context_line":"        response \u003d shortcuts.redirect(settings.LOGIN_REDIRECT_URL)"},{"line_number":307,"context_line":"    utils.set_response_cookie(response, \u0027recent_project\u0027,"},{"line_number":308,"context_line":"                              request.user.project_id)"},{"line_number":309,"context_line":"    return response"}],"source_content_type":"text/x-python","patch_set":1,"id":"9df8c20b_ab1d5159","line":306,"in_reply_to":"57f54f4d_16870951","updated":"2022-05-25 09:57:34.000000000","message":"I think Randomir\u0027s suggestion is to replace the first shortcuts.redirect (at L.304)  with HttpResponseRedirect (as \"redirect_to\" always contains an URL in horizon and we don\u0027t need to resolve it as a view name). If so, we will get 404 instead of 500.","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"},{"author":{"_account_id":27838,"name":"Vadym Markov","email":"vmarkov@mirantis.com","username":"vmarkov"},"change_message_id":"c38cd1f8e0c0589588f2290f32f89b7755cf55a0","unresolved":true,"context_lines":[{"line_number":303,"context_line":"    try:"},{"line_number":304,"context_line":"        response \u003d shortcuts.redirect(redirect_to)"},{"line_number":305,"context_line":"    except NoReverseMatch:"},{"line_number":306,"context_line":"        response \u003d shortcuts.redirect(settings.LOGIN_REDIRECT_URL)"},{"line_number":307,"context_line":"    utils.set_response_cookie(response, \u0027recent_project\u0027,"},{"line_number":308,"context_line":"                              request.user.project_id)"},{"line_number":309,"context_line":"    return response"}],"source_content_type":"text/x-python","patch_set":1,"id":"080b49db_f7e7657d","line":306,"in_reply_to":"6e584a79_d079c7c8","updated":"2022-03-12 16:57:19.000000000","message":"Sorry, didn\u0027t catch an idea. In this try-except block i\u0027m trying to validate if redirect_to is valid path. Not sure if HttpResponseRedirect will help here","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"},{"author":{"_account_id":27838,"name":"Vadym Markov","email":"vmarkov@mirantis.com","username":"vmarkov"},"change_message_id":"d0b1066bc5b7aeaff27f26aa5e1f88f2ff0d4d8b","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    try:"},{"line_number":304,"context_line":"        response \u003d shortcuts.redirect(redirect_to)"},{"line_number":305,"context_line":"    except NoReverseMatch:"},{"line_number":306,"context_line":"        response \u003d shortcuts.redirect(settings.LOGIN_REDIRECT_URL)"},{"line_number":307,"context_line":"    utils.set_response_cookie(response, \u0027recent_project\u0027,"},{"line_number":308,"context_line":"                              request.user.project_id)"},{"line_number":309,"context_line":"    return response"}],"source_content_type":"text/x-python","patch_set":1,"id":"57f54f4d_16870951","line":306,"in_reply_to":"deacbd83_8c311e89","updated":"2022-05-24 17:34:12.000000000","message":"Updated","commit_id":"c8853cc9baa59667ac0626f7fac7dd5da651c9b9"}]}
