)]}'
{"openstack_dashboard/views.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"a8610389563a529627258922ddd5a28fb9b0df12","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        try:"},{"line_number":37,"context_line":"            dashboard \u003d horizon.get_dashboard(\u0027identity\u0027)"},{"line_number":38,"context_line":"        except base.NotRegistered:"},{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bff0334d_61a8508b","line":39,"updated":"2017-04-10 19:49:00.000000000","message":"How about using Admin dashboard as a fallback?","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":23757,"name":"Mateusz Kowalski","email":"mko@redhat.com","username":"makowals"},"change_message_id":"0d53c1e10b7e6f497ffaab0aa27e5198ff3d13d1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        try:"},{"line_number":37,"context_line":"            dashboard \u003d horizon.get_dashboard(\u0027identity\u0027)"},{"line_number":38,"context_line":"        except base.NotRegistered:"},{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7ffa3b31_b877fb3a","line":39,"in_reply_to":"7ffa3b31_1825cfab","updated":"2017-04-18 11:52:06.000000000","message":"Ahh, my understanding of this idea was \"if no identity, then admin\".\n\nIf I get it correctly now and it\u0027s \"if no identity, then admin, if no admin, then default\" I don\u0027t see any problem with this approach, sorry for my misunderstanding","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":23757,"name":"Mateusz Kowalski","email":"mko@redhat.com","username":"makowals"},"change_message_id":"034ded26b151cc26a66927b774e469bf0fbfeb19","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        try:"},{"line_number":37,"context_line":"            dashboard \u003d horizon.get_dashboard(\u0027identity\u0027)"},{"line_number":38,"context_line":"        except base.NotRegistered:"},{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7ffa3b31_e4672051","line":39,"in_reply_to":"7ffa3b31_445a54f3","updated":"2017-04-18 09:43:03.000000000","message":"I\u0027m strongly against this solution. We don\u0027t use Admin dashboard at all, so it would just generate more issues.","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7dae200c7e82a31017215656a52962d741fbd8fe","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        try:"},{"line_number":37,"context_line":"            dashboard \u003d horizon.get_dashboard(\u0027identity\u0027)"},{"line_number":38,"context_line":"        except base.NotRegistered:"},{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7ffa3b31_1825cfab","line":39,"in_reply_to":"7ffa3b31_e4672051","updated":"2017-04-18 11:34:05.000000000","message":"My idea does not enforce Admin dashboard. It is just to try L.36-39 for \u0027identity\u0027 and \u0027admin\u0027 dashboards and then fallbqack to L.41 (get_default_dashboard). What is more issue you see?\n\nAnyway I don\u0027t want to block this change as the bug fix is more important.","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":14394,"name":"Dale Smith","email":"dale@catalystcloud.nz","username":"dalees"},"change_message_id":"4f35a52e62abf1c9163222b22b5bb992db045394","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        try:"},{"line_number":37,"context_line":"            dashboard \u003d horizon.get_dashboard(\u0027identity\u0027)"},{"line_number":38,"context_line":"        except base.NotRegistered:"},{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7ffa3b31_445a54f3","line":39,"in_reply_to":"bff0334d_61a8508b","updated":"2017-04-18 09:31:48.000000000","message":"I don\u0027t really have an opinion on this either way, but it would complicate the code as we\u0027d need to handle the case where the admin dashboard is also not registered.\n\nI can look into this implementation if desired, but I think getting the default seems reasonable, and resolves the issue in the bug.\nA config option could also be added for \u0027ADMIN_DEFAULT_DASHBOARD\u0027, but I\u0027m not sure I see the value in this.","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":23757,"name":"Mateusz Kowalski","email":"mko@redhat.com","username":"makowals"},"change_message_id":"e6c13acf292bfe3623520a6b3efb9b9b77ec318e","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    return dashboard.get_absolute_url()"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bff0334d_3d7aaf87","line":42,"updated":"2017-04-07 12:16:07.000000000","message":"Hi, how about moving this assignment into \"except\" block? I think it would improve readability, but I may be wrong","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"79a24b32e8ffd4da186978aa9680738e802b5893","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    return dashboard.get_absolute_url()"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bff0334d_c1ea7cd6","line":42,"in_reply_to":"bff0334d_08120bb2","updated":"2017-04-10 19:46:23.000000000","message":"The proposed code looks reasonable to me. \nget_default_dashboard() is called for non-admin user, so we cannot move this to except clause.","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":14394,"name":"Dale Smith","email":"dale@catalystcloud.nz","username":"dalees"},"change_message_id":"19e0abc566d6e08f548c56166d31e579fde5c1d4","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    return dashboard.get_absolute_url()"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bff0334d_08120bb2","line":42,"in_reply_to":"bff0334d_280a6f20","updated":"2017-04-07 12:53:53.000000000","message":"The cost of get_default_dashboard is pretty low as it\u0027s either O(1) for a dict access or O(n) where n is the number of registered dashboard panels.\n\nHappy to initialise the dashboard variable to get_default_dashboard() if it improves readability, what do you think?","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"},{"author":{"_account_id":14394,"name":"Dale Smith","email":"dale@catalystcloud.nz","username":"dalees"},"change_message_id":"78fc0a66aaedcde04d659107cb8562111fe727b2","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    if dashboard is None:"},{"line_number":42,"context_line":"        dashboard \u003d horizon.get_default_dashboard()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    return dashboard.get_absolute_url()"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bff0334d_280a6f20","line":42,"in_reply_to":"bff0334d_3d7aaf87","updated":"2017-04-07 12:41:27.000000000","message":"There are two code paths that use this, one is the except block and the other is when the user is not an admin.\n\nI think you\u0027d end up with duplicated code if it were moved into the except as you\u0027d still have to cover the non-admin case.\n\nDepending on the cost of calling get_default_dashboard(), dashboard could be initialised with the default, and then the only thing left is the admin case which would be a small subset of the requests (where you\u0027d perform another dashboard lookup).","commit_id":"87b2a0544a19e81bd1351fc77d54295132dda8f9"}]}
