mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix: added meaningful exception for loading births error (#11407)
* Added exception for loading data without previous loaded test users. * Changed general exception to NoDataException * Changed import to absolute path
This commit is contained in:
parent
8ee6493233
commit
b49fd65cf7
@ -25,6 +25,7 @@ from sqlalchemy.sql import column
|
||||
from superset import db, security_manager
|
||||
from superset.connectors.base.models import BaseDatasource
|
||||
from superset.connectors.sqla.models import SqlMetric, TableColumn
|
||||
from superset.exceptions import NoDataException
|
||||
from superset.models.core import Database
|
||||
from superset.models.dashboard import Dashboard
|
||||
from superset.models.slice import Slice
|
||||
@ -41,6 +42,12 @@ from .helpers import (
|
||||
)
|
||||
|
||||
admin = security_manager.find_user("admin")
|
||||
if admin is None:
|
||||
raise NoDataException(
|
||||
"Admin user does not exist. "
|
||||
"Please, check if test users are properly loaded "
|
||||
"(`superset load_test_users`)."
|
||||
)
|
||||
|
||||
|
||||
def gen_filter(
|
||||
|
Loading…
Reference in New Issue
Block a user