Skip to content

Commit

Permalink
fix(sqllab): Fix tab state (#20947)
Browse files Browse the repository at this point in the history
* Fix tab state

* Update sql_lab.py
  • Loading branch information
lyndsiWilliams authored Aug 2, 2022
1 parent ac58582 commit c06d5eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/views/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ def post(self) -> FlaskResponse: # pylint: disable=no-self-use
query_editor = json.loads(request.form["queryEditor"])
tab_state = TabState(
user_id=get_user_id(),
label=query_editor.get("title", "Untitled Query"),
# This is for backward compatibility
label=query_editor.get("name")
or query_editor.get("title", "Untitled Query"),
active=True,
database_id=query_editor["dbId"],
schema=query_editor.get("schema"),
Expand Down

0 comments on commit c06d5eb

Please sign in to comment.