)]}'
{"openstack_dashboard/dashboards/admin/images/tables.py":[{"author":{"_account_id":12071,"name":"Richard Jones","email":"r1chardj0n3s@gmail.com","username":"richard"},"change_message_id":"ac4bd25e109684b81b920a0a4f75cb5feb79691c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            tenant_dict \u003d dict([(t.id, t.name) for t in tenants])"},{"line_number":76,"context_line":"            image.tenant_name \u003d tenant_dict.get(image.owner)"},{"line_number":77,"context_line":"        return image"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_a8c055e1","line":76,"updated":"2015-09-16 04:40:55.000000000","message":"I know it\u0027s going to be one additional line of code (two if you also \"break\"), but I think constructing a dict() for this purpose is rather unnecessary.","commit_id":"b290af1aaf69b75f1a2f8a5ea506de124203848d"},{"author":{"_account_id":8358,"name":"zhangguoqing","email":"zhang.guoqing@99cloud.net","username":"zhangguoqing"},"change_message_id":"bb1ed3740123fbc27f05f8d2961b5a0477f5b6db","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                msg \u003d _(\u0027Unable to retrieve project list.\u0027)"},{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            tenant_dict \u003d dict([(t.id, t.name) for t in tenants])"},{"line_number":76,"context_line":"            image.tenant_name \u003d tenant_dict.get(image.owner)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return image"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_38a8e51f","line":75,"updated":"2015-09-17 01:44:19.000000000","message":"The two lines can be compactly that you should abandon dict. And you can try \u0027for\u0027 and \u0027if\u0027 at one line to deal with it. Thanks.\n\nimage.tenant_name \u003d [t.name for t in tenants if image.owner \u003d\u003d t.id][0]","commit_id":"7182fee7cfecc5962adac1f8e81a104ca40e0f40"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"231c3d9b4815b3238f10f45b6c46a3046d7ae51b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                msg \u003d _(\u0027Unable to retrieve project list.\u0027)"},{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            tenant_dict \u003d dict([(t.id, t.name) for t in tenants])"},{"line_number":76,"context_line":"            image.tenant_name \u003d tenant_dict.get(image.owner)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return image"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_73b19e46","line":75,"in_reply_to":"ba15a1d1_38a8e51f","updated":"2015-09-17 01:54:27.000000000","message":"Done","commit_id":"7182fee7cfecc5962adac1f8e81a104ca40e0f40"},{"author":{"_account_id":12071,"name":"Richard Jones","email":"r1chardj0n3s@gmail.com","username":"richard"},"change_message_id":"7388cbb3dd2263d939eb893cba456ccb17dd8957","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                msg \u003d _(\u0027Unable to retrieve project list.\u0027)"},{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            image.tenant_name \u003d {t.id: t.name for t in tenants}.get(image.owner)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        return image"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba15a1d1_377e806a","line":75,"updated":"2015-09-17 22:41:42.000000000","message":"OK, you\u0027re still creating a dictionary when all you really need to do is iterate through the tenants list and use a simple \"if\" test to find the match. Sorry, but this isn\u0027t elegant, it\u0027s obscure.","commit_id":"225b9a77b91af5b936d4aeabb1c5bc500e2e1ce9"},{"author":{"_account_id":12071,"name":"Richard Jones","email":"r1chardj0n3s@gmail.com","username":"richard"},"change_message_id":"b9dc105dea7ccf7473c870a40115dcdc2899cc2f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                msg \u003d _(\u0027Unable to retrieve project list.\u0027)"},{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            image.tenant_name \u003d {t.id: t.name for t in tenants}.get(image.owner)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        return image"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba15a1d1_cce688af","line":75,"in_reply_to":"ba15a1d1_377e806a","updated":"2015-09-18 12:12:21.000000000","message":"Just to be clear, I\u0027m taking about something simple, clear, straigtforward, not at all trying to be too clever and use dictionary comprehensions for because they\u0027ve just been added to the language:\n\n   for t in tenants:\n      if t.id \u003d\u003d image.owner:\n          image.tenant_name \u003d t.name\n          break\n\nI argue this is much clearer for anyone wandering into this code. The method is not very long, so allowing this search to go over four lines is worth the benefit to readability.","commit_id":"225b9a77b91af5b936d4aeabb1c5bc500e2e1ce9"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"762794fe6e67a8e04be84a569ed0e8bfda5b5ee8","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            except Exception:"},{"line_number":71,"context_line":"                tenants \u003d []"},{"line_number":72,"context_line":"                msg \u003d _(\u0027Unable to retrieve project list.\u0027)"},{"line_number":73,"context_line":"                exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            for t in tenants:"},{"line_number":76,"context_line":"                if t.id \u003d\u003d image.owner:"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_a54537b4","line":73,"updated":"2015-09-21 07:59:37.000000000","message":"i don\u0027t think we have to show a error message for not getting the tenant list.\ni guess, warning is enough. Log the messages also useful.","commit_id":"2b559c0631543ed9bc3e3f9038ff86d896f7b99c"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"762794fe6e67a8e04be84a569ed0e8bfda5b5ee8","unresolved":false,"context_lines":[{"line_number":92,"context_line":"class AdminImagesTable(project_tables.ImagesTable):"},{"line_number":93,"context_line":"    name \u003d tables.Column(\"name\","},{"line_number":94,"context_line":"                         link\u003d\"horizon:admin:images:detail\","},{"line_number":95,"context_line":"                         verbose_name\u003d_(\"Image Name\"))"},{"line_number":96,"context_line":"    tenant \u003d tables.Column(\"tenant_name\", verbose_name\u003d_(\"Project\"))"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    class Meta(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_e569ef26","line":95,"updated":"2015-09-21 07:59:37.000000000","message":"if there is error/exception while getting tenant list, we are getting attribute error here.","commit_id":"2b559c0631543ed9bc3e3f9038ff86d896f7b99c"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"f071e9384a1073a7f5eb3836a144195000691ba9","unresolved":false,"context_lines":[{"line_number":92,"context_line":"class AdminImagesTable(project_tables.ImagesTable):"},{"line_number":93,"context_line":"    name \u003d tables.Column(\"name\","},{"line_number":94,"context_line":"                         link\u003d\"horizon:admin:images:detail\","},{"line_number":95,"context_line":"                         verbose_name\u003d_(\"Image Name\"))"},{"line_number":96,"context_line":"    tenant \u003d tables.Column(\"tenant_name\", verbose_name\u003d_(\"Project\"))"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    class Meta(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_d78fbaca","line":95,"in_reply_to":"ba15a1d1_d4a6d852","updated":"2015-09-21 10:42:46.000000000","message":"you have to use like this\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/identity/users/tables.py#L238","commit_id":"2b559c0631543ed9bc3e3f9038ff86d896f7b99c"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"78f6bc3b585163f7383b2ba713e1e5c592f6db5e","unresolved":false,"context_lines":[{"line_number":92,"context_line":"class AdminImagesTable(project_tables.ImagesTable):"},{"line_number":93,"context_line":"    name \u003d tables.Column(\"name\","},{"line_number":94,"context_line":"                         link\u003d\"horizon:admin:images:detail\","},{"line_number":95,"context_line":"                         verbose_name\u003d_(\"Image Name\"))"},{"line_number":96,"context_line":"    tenant \u003d tables.Column(\"tenant_name\", verbose_name\u003d_(\"Project\"))"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    class Meta(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_d4a6d852","line":95,"in_reply_to":"ba15a1d1_e569ef26","updated":"2015-09-21 10:13:18.000000000","message":"Hi, Masco, here is the general exception, can not give the clear exception.","commit_id":"2b559c0631543ed9bc3e3f9038ff86d896f7b99c"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"82e67fd9a6fb7eb48af7f4f50d33b0c7db4aef57","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from django.utils.translation import ugettext_lazy as _"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from horizon import exceptions"},{"line_number":20,"context_line":"from horizon import tables"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from openstack_dashboard import api"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_9640cba6","line":19,"updated":"2015-09-24 06:51:12.000000000","message":"not used. please remove.","commit_id":"ab3e8064721a1ce5347aebba9aab22f293bd2e0f"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"3158bf55c210527226c8ff181052c0c5c58914f5","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from django.utils.translation import ugettext_lazy as _"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from horizon import exceptions"},{"line_number":20,"context_line":"from horizon import tables"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from openstack_dashboard import api"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_16efdb87","line":19,"in_reply_to":"ba15a1d1_9640cba6","updated":"2015-09-24 06:56:13.000000000","message":"Done","commit_id":"ab3e8064721a1ce5347aebba9aab22f293bd2e0f"},{"author":{"_account_id":4428,"name":"Liyingjun","email":"yinjalee@163.com","username":"liyingjun"},"change_message_id":"1d538b715a605be169392370bc7f3ec1894b85ff","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        image \u003d api.glance.image_get(request, image_id)"},{"line_number":70,"context_line":"        if image:"},{"line_number":71,"context_line":"            try:"},{"line_number":72,"context_line":"                tenants, more \u003d api.keystone.tenant_list(request)"},{"line_number":73,"context_line":"            except Exception:"},{"line_number":74,"context_line":"                tenants \u003d []"},{"line_number":75,"context_line":"                LOG.warning(\"Unable to retrieve project list.\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_9e9197f3","line":72,"updated":"2015-12-14 11:19:15.000000000","message":"imo, tenant_get would be better here.","commit_id":"c0c998eafb809e3b6688e6a4388f9a4153342887"},{"author":{"_account_id":8686,"name":"Wang Bo","email":"bo.wang@easystack.cn","username":"wangbo"},"change_message_id":"3201caa75b711823b82677d6af5c933952255ac1","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from openstack_dashboard.dashboards.project.images.images \\"},{"line_number":23,"context_line":"    import tables as project_tables"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class AdminCreateImage(project_tables.CreateImage):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_1db47af0","line":25,"updated":"2015-12-15 10:19:52.000000000","message":"please remove this line if not use LOG in following code","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"06ad84d8c10950dd14197170e7804e7fa56ee6b9","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from openstack_dashboard.dashboards.project.images.images \\"},{"line_number":23,"context_line":"    import tables as project_tables"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class AdminCreateImage(project_tables.CreateImage):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_df8902cc","line":25,"in_reply_to":"5a710552_1db47af0","updated":"2015-12-15 12:10:48.000000000","message":"Done","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":8686,"name":"Wang Bo","email":"bo.wang@easystack.cn","username":"wangbo"},"change_message_id":"3201caa75b711823b82677d6af5c933952255ac1","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def get_data(self, request, image_id):"},{"line_number":69,"context_line":"        image \u003d api.glance.image_get(request, image_id)"},{"line_number":70,"context_line":"        tenant_id \u003d getattr(image, \"owner\")"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            tenant \u003d api.keystone.tenant_get(request, tenant_id)"},{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_ddca724f","line":70,"updated":"2015-12-15 10:19:52.000000000","message":"IMO, it\u0027s better to move this line into \"try:\"  statement.","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"06ad84d8c10950dd14197170e7804e7fa56ee6b9","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def get_data(self, request, image_id):"},{"line_number":69,"context_line":"        image \u003d api.glance.image_get(request, image_id)"},{"line_number":70,"context_line":"        tenant_id \u003d getattr(image, \"owner\")"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            tenant \u003d api.keystone.tenant_get(request, tenant_id)"},{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_bff9964f","line":70,"in_reply_to":"5a710552_ddca724f","updated":"2015-12-15 12:10:48.000000000","message":"Done","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"7f04bb1d7e398bc9d55a74e8bdc6396c63336071","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        tenant_id \u003d getattr(image, \"owner\")"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            tenant \u003d api.keystone.tenant_get(request, tenant_id)"},{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"},{"line_number":74,"context_line":"        except Exception:"},{"line_number":75,"context_line":"            msg \u003d _(\u0027Unable to retrieve image project information.\u0027)"},{"line_number":76,"context_line":"            exceptions.handle(request, msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_f0f51583","line":73,"updated":"2015-12-15 10:33:39.000000000","message":"you can add the project id if the name is not available.","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"06ad84d8c10950dd14197170e7804e7fa56ee6b9","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        tenant_id \u003d getattr(image, \"owner\")"},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            tenant \u003d api.keystone.tenant_get(request, tenant_id)"},{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"},{"line_number":74,"context_line":"        except Exception:"},{"line_number":75,"context_line":"            msg \u003d _(\u0027Unable to retrieve image project information.\u0027)"},{"line_number":76,"context_line":"            exceptions.handle(request, msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_1f122a63","line":73,"in_reply_to":"5a710552_f0f51583","updated":"2015-12-15 12:10:48.000000000","message":"Hi, Masco, I don\u0027t think we can add the project id here, if really need, it can add to the AdminImagesTable() getattr method.","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":8686,"name":"Wang Bo","email":"bo.wang@easystack.cn","username":"wangbo"},"change_message_id":"3201caa75b711823b82677d6af5c933952255ac1","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"},{"line_number":74,"context_line":"        except Exception:"},{"line_number":75,"context_line":"            msg \u003d _(\u0027Unable to retrieve image project information.\u0027)"},{"line_number":76,"context_line":"            exceptions.handle(request, msg)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return image"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_7da6dec2","line":76,"updated":"2015-12-15 10:19:52.000000000","message":"maybe forget to import exceptions?","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":14107,"name":"zhurong","email":"aaronzhu1121@gmail.com","username":"zhurong"},"change_message_id":"06ad84d8c10950dd14197170e7804e7fa56ee6b9","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"},{"line_number":74,"context_line":"        except Exception:"},{"line_number":75,"context_line":"            msg \u003d _(\u0027Unable to retrieve image project information.\u0027)"},{"line_number":76,"context_line":"            exceptions.handle(request, msg)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        return image"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_9f4e1ac0","line":76,"in_reply_to":"5a710552_7da6dec2","updated":"2015-12-15 12:10:48.000000000","message":"Done","commit_id":"6717e116cbe32b61c4154dd8e03047da92d8ea39"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"52e25fe22c0b3b77fe242fbcf7008eeee6894def","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            tenant \u003d api.keystone.tenant_get(request, tenant_id)"},{"line_number":70,"context_line":"            image.tenant_name \u003d getattr(tenant, \"name\")"},{"line_number":71,"context_line":"        except Exception:"},{"line_number":72,"context_line":"            msg \u003d _(\u0027Unable to retrieve image project information.\u0027)"},{"line_number":73,"context_line":"            exceptions.handle(request, msg)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        return image"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_6891aaf0","line":72,"range":{"start_line":72,"start_character":20,"end_line":72,"end_character":67},"updated":"2015-12-21 08:28:34.000000000","message":"this is not looks clear. how about something like, \"Unable to retrieve the project information of the image.\"","commit_id":"2777e5959910228e5e8b28d27e930af390286973"},{"author":{"_account_id":10442,"name":"Masco Kaliyamoorthy","email":"mkaliyam@redhat.com","username":"masco"},"change_message_id":"52e25fe22c0b3b77fe242fbcf7008eeee6894def","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    name \u003d tables.Column(\"name\","},{"line_number":89,"context_line":"                         link\u003d\"horizon:admin:images:detail\","},{"line_number":90,"context_line":"                         verbose_name\u003d_(\"Image Name\"))"},{"line_number":91,"context_line":"    tenant \u003d tables.Column(lambda obj: getattr(obj, \u0027tenant_name\u0027, None),"},{"line_number":92,"context_line":"                           verbose_name\u003d_(\"Project\"))"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    class Meta(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_e8fb5a79","line":91,"range":{"start_line":91,"start_character":67,"end_line":91,"end_character":71},"updated":"2015-12-21 08:28:34.000000000","message":"displaying project id will be good instead of None.","commit_id":"2777e5959910228e5e8b28d27e930af390286973"}]}
