This is an automated email from the ASF dual-hosted git repository.
dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new d59e0c4 [superset] Fix, missing return on error and improved query
(#8239)
d59e0c4 is described below
commit d59e0c464120536c2fa1ee31079c26054029aac3
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Mon Sep 30 00:09:30 2019 +0100
[superset] Fix, missing return on error and improved query (#8239)
---
superset/views/core.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index 72b5a7a..07608fb 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2553,9 +2553,9 @@ class Superset(BaseSupersetView):
)
session = db.session()
- mydb = session.query(models.Database).filter_by(id=database_id).first()
+ mydb =
session.query(models.Database).filter_by(id=database_id).one_or_none()
if not mydb:
- json_error_response(
+ return json_error_response(
"Database with id {} is missing.".format(database_id),
status=400
)