)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"2672ae5672b900b1a7422f4f9422a33b5938eb59","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Uncovered a bug in Python 2.7 tests that was fixed as well"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Fixes-bug: #1292084"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Id4e80dadaa7e6d1a7f3bb621949ef736007162c9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7f96bb07_f34df6c3","line":14,"updated":"2018-01-18 13:08:13.000000000","message":"should be closes-bug","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"}],"openstack_dashboard/dashboards/project/security_groups/tests.py":[{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"2672ae5672b900b1a7422f4f9422a33b5938eb59","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        if six.PY2:"},{"line_number":241,"context_line":"            sec_group.name \u003d \u0027@group name-\\xe3\\x82\\xb3\u0027.decode(\"utf-8\")"},{"line_number":242,"context_line":"        else:"},{"line_number":243,"context_line":"            sec_group.name \u003d \u0027@group name-\\xe3\\x82\\xb3\u0027"},{"line_number":244,"context_line":"        self._create_security_group(sec_group)"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    @test.create_stubs({api.neutron: (\u0027security_group_create\u0027,)})"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_b3f20e6f","line":243,"updated":"2018-01-18 13:08:13.000000000","message":"maybe you should just use a unicode string here?","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":10420,"name":"Adrian Turjak","email":"devs+openstack@uncaught-exceptions.com","username":"adriant"},"change_message_id":"ca25c72fbf50268084d3dd68f86d05694aeae8a7","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        if six.PY2:"},{"line_number":241,"context_line":"            sec_group.name \u003d \u0027@group name-\\xe3\\x82\\xb3\u0027.decode(\"utf-8\")"},{"line_number":242,"context_line":"        else:"},{"line_number":243,"context_line":"            sec_group.name \u003d \u0027@group name-\\xe3\\x82\\xb3\u0027"},{"line_number":244,"context_line":"        self._create_security_group(sec_group)"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    @test.create_stubs({api.neutron: (\u0027security_group_create\u0027,)})"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_2148d62a","line":243,"in_reply_to":"7f96bb07_b3f20e6f","updated":"2018-01-18 20:53:03.000000000","message":"not sure if I get what you mean. We were mostly trying to solve this in the simplest form possible.\n\nBasically, turns out this test was failing since creation because python2 + mox wasn\u0027t handling the characters at all, and the test was only checking for a redirect (which on both success and exception went to the same place anyway). So all we did was correctly decode the string for python2, and now it actually does what the test intended.","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"}],"openstack_dashboard/dashboards/project/security_groups/views.py":[{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"2672ae5672b900b1a7422f4f9422a33b5938eb59","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"},{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            handled \u003d None"},{"line_number":184,"context_line":"            exceptions.handle(self.request)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_739d6608","line":182,"updated":"2018-01-18 13:08:13.000000000","message":"Can you catch a specific exception that you expect here?","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":10420,"name":"Adrian Turjak","email":"devs+openstack@uncaught-exceptions.com","username":"adriant"},"change_message_id":"eb2a4c2e65023437c5badc9a1f0b2a130542c0be","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"},{"line_number":182,"context_line":"        except Exception:"},{"line_number":183,"context_line":"            handled \u003d None"},{"line_number":184,"context_line":"            exceptions.handle(self.request)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_7e9d1fba","line":182,"in_reply_to":"7f96bb07_739d6608","updated":"2018-01-18 20:03:17.000000000","message":"Mostly this is taken directly from:\nhttps://github.com/openstack/horizon/blob/master/horizon/forms/views.py#L183-L216\n\nThis function is mostly a simplified version of the inherited one, so to be safe, we left it catching everything.","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"2672ae5672b900b1a7422f4f9422a33b5938eb59","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            handled \u003d None"},{"line_number":184,"context_line":"            exceptions.handle(self.request)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        if handled:"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            success_url \u003d self.get_success_url(handled)"},{"line_number":189,"context_line":"            response \u003d http.HttpResponseRedirect(success_url)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_338b5ec3","line":186,"updated":"2018-01-18 13:08:13.000000000","message":"this could be put in the else clause of the try above","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":10420,"name":"Adrian Turjak","email":"devs+openstack@uncaught-exceptions.com","username":"adriant"},"change_message_id":"eb2a4c2e65023437c5badc9a1f0b2a130542c0be","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            handled \u003d None"},{"line_number":184,"context_line":"            exceptions.handle(self.request)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        if handled:"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            success_url \u003d self.get_success_url(handled)"},{"line_number":189,"context_line":"            response \u003d http.HttpResponseRedirect(success_url)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_de5c731a","line":186,"in_reply_to":"7f96bb07_338b5ec3","updated":"2018-01-18 20:03:17.000000000","message":"good idea.","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"2672ae5672b900b1a7422f4f9422a33b5938eb59","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        else:"},{"line_number":197,"context_line":"            # If handled didn\u0027t return, we can assume something went"},{"line_number":198,"context_line":"            # wrong, and we should send back the form as-is."},{"line_number":199,"context_line":"            return self.form_invalid(form)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class IndexView(tables.DataTableView):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_138c22d5","line":199,"updated":"2018-01-18 13:08:13.000000000","message":"this could go in the except clause of the try above","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":10420,"name":"Adrian Turjak","email":"devs+openstack@uncaught-exceptions.com","username":"adriant"},"change_message_id":"eb2a4c2e65023437c5badc9a1f0b2a130542c0be","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        else:"},{"line_number":197,"context_line":"            # If handled didn\u0027t return, we can assume something went"},{"line_number":198,"context_line":"            # wrong, and we should send back the form as-is."},{"line_number":199,"context_line":"            return self.form_invalid(form)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class IndexView(tables.DataTableView):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_be6167d5","line":199,"in_reply_to":"7f96bb07_138c22d5","updated":"2018-01-18 20:03:17.000000000","message":"good idea","commit_id":"c6403e9b024a119de851eaac97ff3fa23fe20c0f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"39da35e89d76c89799d38595f166d8bbdb14d98c","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    submit_label \u003d _(\"Create Security Group\")"},{"line_number":170,"context_line":"    submit_url \u003d reverse_lazy("},{"line_number":171,"context_line":"        \"horizon:project:security_groups:create\")"},{"line_number":172,"context_line":"    success_url \u003d reverse_lazy(\u0027horizon:project:security_groups:index\u0027)"},{"line_number":173,"context_line":"    page_title \u003d _(\"Create Security Group\")"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def get_success_url(self, security_group):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_68e21332","line":172,"range":{"start_line":172,"start_character":4,"end_line":172,"end_character":71},"updated":"2018-01-21 09:32:00.000000000","message":"Is this still needed?","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"39da35e89d76c89799d38595f166d8bbdb14d98c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    page_title \u003d _(\"Create Security Group\")"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def get_success_url(self, security_group):"},{"line_number":176,"context_line":"        return reverse_lazy(\u0027horizon:project:security_groups:detail\u0027,"},{"line_number":177,"context_line":"                            args\u003d[security_group.id])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def form_valid(self, form):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_48e5d737","line":176,"range":{"start_line":176,"start_character":15,"end_line":176,"end_character":28},"updated":"2018-01-21 09:32:00.000000000","message":"Use reverse() because the returned value is used just after returned.","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"39da35e89d76c89799d38595f166d8bbdb14d98c","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def get_success_url(self, security_group):"},{"line_number":176,"context_line":"        return reverse_lazy(\u0027horizon:project:security_groups:detail\u0027,"},{"line_number":177,"context_line":"                            args\u003d[security_group.id])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_a8d81b7f","line":178,"updated":"2018-01-21 09:32:00.000000000","message":"This works, but I think it is better to enhance horizon.forms.ModalFormView to change get_success_url to accept an extra argument.\n\n\nIn my understanding, what you would like to do is to pass a newly created object (handled) to get_success_url at [1], but get_success_url does not accept an argument [2].\n\nHow about the following logic in horizon.forms.views?\n\n  handled \u003d form.handle(self.request, form.cleaned_data)\n  # [0] contains a list of positional arguments\n  argspec \u003d inspect.getargspec(self.get_success_url)[0]\n  if argspec:\n     success_url \u003d self.get_success_url(handled)\n  else:\n     success_url \u003d self.get_success_url()\n\nand a child class like this can define get_success_url with an argument like L.175.\n\n[1] https://github.com/openstack/horizon/blob/master/horizon/forms/views.py#L200\n[2] https://github.com/django/django/blob/master/django/views/generic/edit.py#L49","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7f4b88095933705643a6e5ee48b06445ee9df815","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def get_success_url(self, security_group):"},{"line_number":176,"context_line":"        return reverse_lazy(\u0027horizon:project:security_groups:detail\u0027,"},{"line_number":177,"context_line":"                            args\u003d[security_group.id])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_19139568","line":178,"in_reply_to":"7f96bb07_76a506b5","updated":"2018-01-22 10:53:56.000000000","message":"That sounds a good idea. I just would like to enhance the ModalFormView rather than adding a logic in a child class.","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"d976d41551da4bc28529fe695bf210a75085f4c5","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def get_success_url(self, security_group):"},{"line_number":176,"context_line":"        return reverse_lazy(\u0027horizon:project:security_groups:detail\u0027,"},{"line_number":177,"context_line":"                            args\u003d[security_group.id])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_76a506b5","line":178,"in_reply_to":"7f96bb07_a8d81b7f","updated":"2018-01-22 09:54:17.000000000","message":"Using the inspect module strikes me as a suspect solution. Wouldn\u0027t it be better to define a separate method that takes an argument, and call that method if it exists, falling back to get_success_url if it doesn\u0027t?","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"559d3377ccece487b06aff132e08e2ae7bf58380","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def form_valid(self, form):"},{"line_number":180,"context_line":"        try:"},{"line_number":181,"context_line":"            handled \u003d form.handle(self.request, form.cleaned_data)"},{"line_number":182,"context_line":"            success_url \u003d self.get_success_url(handled)"},{"line_number":183,"context_line":"            response \u003d http.HttpResponseRedirect(success_url)"},{"line_number":184,"context_line":"            # TODO(gabriel): This is not a long-term solution to how"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_c4e1f22c","line":181,"updated":"2018-01-19 09:08:34.000000000","message":"You don\u0027t need the \"handled\" variable anymore.","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"559d3377ccece487b06aff132e08e2ae7bf58380","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            # until the blueprint for AJAX handling is architected"},{"line_number":187,"context_line":"            # and implemented."},{"line_number":188,"context_line":"            response[\u0027X-Horizon-Location\u0027] \u003d success_url"},{"line_number":189,"context_line":"            return response"},{"line_number":190,"context_line":"        except Exception:"},{"line_number":191,"context_line":"            handled \u003d None"},{"line_number":192,"context_line":"            exceptions.handle(self.request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_44f642fc","line":189,"updated":"2018-01-19 09:08:34.000000000","message":"Can you put all but the first line in an else clause of the try, so that we don\u0027t catch the exceptions that happen in it?","commit_id":"5685c8e177a364083d639b47149ab27f0d72df02"}]}
