mirror of https://github.com/apache/superset.git
[superset] Fix, missing return on error and improved query (#8239)
This commit is contained in:
parent
7ea769228e
commit
d59e0c4641
|
@ -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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue