)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":21800,"name":"Cedric Savignan","email":"cedric.savignan@orange.com","username":"csavignan"},"change_message_id":"12851f3647677bc5d363c8f08e0748db01fc4758","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"dashboard: allow bgpvpns with the same name"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change fix validation of RT, RT and ET"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The BGPVPN API allow to use a same name for"},{"line_number":12,"context_line":"differents BGPVPNs."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f201791_2338449e","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":43},"updated":"2017-06-23 16:02:51.000000000","message":"Bad copy paste. I will fix next time.","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"}],"bgpvpn_dashboard/dashboards/project/bgpvpn/forms.py":[{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"5289eed1ce6ccd70bf7fae0cc4ae3aab71744da5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_deaf30e1","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"updated":"2017-06-23 11:22:37.000000000","message":"Unrelated to this patch, but I\u0027m wondering: why is this only done for a super user ?","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"},{"author":{"_account_id":21800,"name":"Cedric Savignan","email":"cedric.savignan@orange.com","username":"csavignan"},"change_message_id":"9150b96884747cc173910da2c04d5fd41a20d8e5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_435fc00d","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"in_reply_to":"5f201791_b256e45b","updated":"2017-06-23 15:59:08.000000000","message":"I\u0027ve tested. It doesn\u0027t work. It require few others modifications. I will initiate a new patch for this.","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"d4e5a83ce6292a3d60544539e53351a443314c5e","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b256e45b","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"in_reply_to":"5f201791_b2e70413","updated":"2017-06-23 14:35:05.000000000","message":"Why not simply do \n\n ...   data.pop(key, []) \n\nat line 80 ?\n\nDoing so should not require any particular preparation in clean(), right ?","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"e5f512ae584bec96ee466eaeddc12d8d0667d56f","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_cf9898c1","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"in_reply_to":"5f201791_b9d80e7f","updated":"2017-06-23 13:02:25.000000000","message":"Yes, you understood well what admin/non-admin users can do with RTs :)\n\nHowever, I wonder what breaks if these fields are not in the API request: my gut feeling is that this should still be a valid request since these fields are optional (even for superuser).","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"},{"author":{"_account_id":21800,"name":"Cedric Savignan","email":"cedric.savignan@orange.com","username":"csavignan"},"change_message_id":"e101990f02e25a27a83ab383eeb369cb17ddb843","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b2e70413","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"in_reply_to":"5f201791_cf9898c1","updated":"2017-06-23 14:23:28.000000000","message":"Yes I see, it\u0027s not optimal. Perhaps at line 54 \"del cleaned_data[attribute]\" will be better with \"if key in params:\" at line 80","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"},{"author":{"_account_id":21800,"name":"Cedric Savignan","email":"cedric.savignan@orange.com","username":"csavignan"},"change_message_id":"6495bf7e566be83b529f1381d17485c1da48d5d2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":50,"context_line":"        try:"},{"line_number":51,"context_line":"            if self.request.user.is_superuser:"},{"line_number":52,"context_line":"                for attribute in bgpvpn_common.RT_FORMAT_ATTRIBUTES:"},{"line_number":53,"context_line":"                    if not cleaned_data.get(attribute):"},{"line_number":54,"context_line":"                        cleaned_data[attribute] \u003d None"},{"line_number":55,"context_line":"                # if an admin user use the bgpvpn panel project"},{"line_number":56,"context_line":"                # tenant_id field doesn\u0027t exist"},{"line_number":57,"context_line":"                if not cleaned_data.get(\u0027tenant_id\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f201791_b9d80e7f","line":54,"range":{"start_line":52,"start_character":16,"end_line":54,"end_character":54},"in_reply_to":"5f201791_deaf30e1","updated":"2017-06-23 12:06:31.000000000","message":"Because in the edit BGPVPN form for a non admin user, RT fields doesn\u0027t exist and so the fields RT are not included in the API request.\nIf I remember a non user admin can\u0027t edit RT fields in the API.\nHope this time I understood well :D","commit_id":"328c186949b072ee34a98c3fd7c765dd4a8b55f9"}]}
