From b93a7e57e7fa7b930b8cbc3445a098c8d2f9e7a7 Mon Sep 17 00:00:00 2001 From: Juraj Majerik Date: Fri, 27 Oct 2023 15:38:53 +0200 Subject: [PATCH] fix(projects): reload organization after project creation (#18198) * reload org after project creation * call loadCurrentOrganization in createTeamSuccess listener --- frontend/src/scenes/teamLogic.tsx | 3 +++ hogql_parser/parser.cpp | 8 +++++--- hogql_parser/string.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/scenes/teamLogic.tsx b/frontend/src/scenes/teamLogic.tsx index 17def88cb67ef..be21abb60f6da 100644 --- a/frontend/src/scenes/teamLogic.tsx +++ b/frontend/src/scenes/teamLogic.tsx @@ -206,6 +206,9 @@ export const teamLogic = kea([ ], })), listeners(({ actions }) => ({ + createTeamSuccess: () => { + organizationLogic.actions.loadCurrentOrganization() + }, deleteTeam: async ({ team }) => { try { await api.delete(`api/projects/${team.id}`) diff --git a/hogql_parser/parser.cpp b/hogql_parser/parser.cpp index 4d004e3d0086d..f2f6254be2192 100644 --- a/hogql_parser/parser.cpp +++ b/hogql_parser/parser.cpp @@ -37,7 +37,7 @@ err_indicator = PyObject_SetAttrString(py_err, "end", py_end); \ if (err_indicator == -1) goto exit##TYPE; \ PyErr_SetObject(error_type, py_err); \ - exit##TYPE:; \ + exit##TYPE :; \ Py_XDECREF(py_end); \ Py_XDECREF(py_start); \ Py_XDECREF(py_err); \ @@ -2096,7 +2096,8 @@ static PyMethodDef parser_methods[] = { .ml_meth = method_unquote_string, .ml_flags = METH_VARARGS, .ml_doc = "Unquote the string (an identifier or a string literal))"}, - {NULL, NULL, 0, NULL}}; + {NULL, NULL, 0, NULL} +}; static int parser_modexec(PyObject* module) { parser_state* state = get_module_state(module); @@ -2118,7 +2119,8 @@ static int parser_modexec(PyObject* module) { static PyModuleDef_Slot parser_slots[] = { {Py_mod_exec, (void*)parser_modexec}, // If Python were written in C++, then Py_mod_exec would be typed better, but // because it's in C, it expects a void pointer - {0, NULL}}; + {0, NULL} +}; static int parser_traverse(PyObject* module, visitproc visit, void* arg) { parser_state* state = get_module_state(module); diff --git a/hogql_parser/string.cpp b/hogql_parser/string.cpp index a5df4f4e89d6e..e5165bfaa37ab 100644 --- a/hogql_parser/string.cpp +++ b/hogql_parser/string.cpp @@ -40,7 +40,7 @@ string unquote_string(string text) { boost::replace_all(text, "\\r", "\r"); boost::replace_all(text, "\\t", "\t"); boost::replace_all(text, "\\v", "\v"); - boost::replace_all(text, "\\0", ""); // NUL characters are ignored + boost::replace_all(text, "\\0", ""); // NUL characters are ignored boost::replace_all(text, "\\\\", "\\"); return text;