)]}'
{"mistral/services/triggers.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"51ec5f571609c8f392827953aad487968dc4c8de","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        security.add_trust_id(values)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        try:"},{"line_number":127,"context_line":"            trig \u003d db_api.create_cron_trigger(values)"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            # Delete trust before raising exception."},{"line_number":130,"context_line":"            security.delete_trust(values.get(\u0027trust_id\u0027))"},{"line_number":131,"context_line":"            raise"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    return trig"},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df140735_3b689f1f","line":131,"range":{"start_line":126,"start_character":8,"end_line":131,"end_character":17},"updated":"2017-05-31 06:09:07.000000000","message":"I\u0027m not 100% sure but maybe we need to put the entire transaction under this try-except block? Then even if the cron triggered is created but the transaction is not committed for some reason we will still delete the trust.\n\nWhat do you think?","commit_id":"32f1b6f997111e30660705008afa90169021728e"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"be615105309a71e13f28a194f731264242f5c8fc","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        security.add_trust_id(values)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        try:"},{"line_number":127,"context_line":"            trig \u003d db_api.create_cron_trigger(values)"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            # Delete trust before raising exception."},{"line_number":130,"context_line":"            security.delete_trust(values.get(\u0027trust_id\u0027))"},{"line_number":131,"context_line":"            raise"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    return trig"},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df140735_5b0eb33b","line":131,"range":{"start_line":126,"start_character":8,"end_line":131,"end_character":17},"in_reply_to":"df140735_3b689f1f","updated":"2017-05-31 06:24:59.000000000","message":"I thought about this but it seems wrong since an error may occur in any place inside transaction and not only at trigger creation. Trust might not exist in this case.\n\nI put only the db operation itself into try-except because only db operation affects trust creation. At this stage trust must be created already and then in case of error we simply delete it.","commit_id":"32f1b6f997111e30660705008afa90169021728e"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"18911ae5d6d37e8bafd068f81222d113a765295c","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        security.add_trust_id(values)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        try:"},{"line_number":127,"context_line":"            trig \u003d db_api.create_cron_trigger(values)"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            # Delete trust before raising exception."},{"line_number":130,"context_line":"            security.delete_trust(values.get(\u0027trust_id\u0027))"},{"line_number":131,"context_line":"            raise"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    return trig"},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"df140735_8d0c0c3c","line":131,"range":{"start_line":126,"start_character":8,"end_line":131,"end_character":17},"in_reply_to":"df140735_5b0eb33b","updated":"2017-05-31 08:03:06.000000000","message":"Ok, let it be (if others don\u0027t object).","commit_id":"32f1b6f997111e30660705008afa90169021728e"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"5fecd8808d794f1894bb8b2e60be32e6300dcf78","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    return trig"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def delete_cron_trigger(name, trust_id\u003dNone):"},{"line_number":137,"context_line":"    if not trust_id:"},{"line_number":138,"context_line":"        trigger \u003d db_api.get_cron_trigger(name)"},{"line_number":139,"context_line":"        trust_id \u003d trigger.trust_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_f0588131","line":136,"range":{"start_line":136,"start_character":30,"end_line":136,"end_character":38},"updated":"2017-06-05 08:14:14.000000000","message":"Seems like we don\u0027t need this parameter but, as far as I understand, it\u0027s just a small optimization in case we already have trust_id (we don\u0027t need to make an extra DB query). Is this correct?","commit_id":"91f7c077b9ab0ef9bc9cd61460ea20d06af41814"},{"author":{"_account_id":7700,"name":"Nikolay Mahotkin","email":"nikolay.makhotkin@gmail.com","username":"nmakhotkin"},"change_message_id":"1f79e56c1776f2a5a1e63a8fd1c006b5b5b65dd8","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    return trig"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def delete_cron_trigger(name, trust_id\u003dNone):"},{"line_number":137,"context_line":"    if not trust_id:"},{"line_number":138,"context_line":"        trigger \u003d db_api.get_cron_trigger(name)"},{"line_number":139,"context_line":"        trust_id \u003d trigger.trust_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_10409506","line":136,"range":{"start_line":136,"start_character":30,"end_line":136,"end_character":38},"in_reply_to":"df140735_f0588131","updated":"2017-06-05 08:22:37.000000000","message":"Exactly.","commit_id":"91f7c077b9ab0ef9bc9cd61460ea20d06af41814"}]}
