MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / save_browser_tree_state

Function save_browser_tree_state

web/pgadmin/settings/__init__.py:203–225  ·  view source on GitHub ↗

Save the browser tree state.

()

Source from the content-addressed store, hash-verified

201 methods=['POST'])
202@pga_login_required
203def save_browser_tree_state():
204 """Save the browser tree state."""
205 data = request.form if request.form else request.data.decode('utf-8')
206 old_data = get_setting('browser_tree_state')
207
208 if old_data and old_data != 'null':
209 if data:
210 data = json.loads(data)
211
212 old_data = json.loads(old_data)
213
214 old_data.update(data)
215 new_data = json.dumps(old_data)
216 else:
217 new_data = data
218
219 try:
220 store_setting('browser_tree_state', new_data)
221 except Exception as e:
222 current_app.logger.exception(e)
223 return internal_server_error(errormsg=str(e))
224
225 return success_return()
226
227
228@blueprint.route("/get_tree_state/", endpoint="get_tree_state",

Callers

nothing calls this directly

Calls 6

internal_server_errorFunction · 0.90
success_returnFunction · 0.90
get_settingFunction · 0.85
store_settingFunction · 0.85
decodeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected