Skip to content

Commit

Permalink
[datasource] Ensuring consistent behavior of datasource editing/savin…
Browse files Browse the repository at this point in the history
…g. (#7037)

* Update datasource.py

* Update datasource.py
  • Loading branch information
john-bodley authored Mar 18, 2019
1 parent 5137539 commit c771625
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions superset/views/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
from flask import request
from flask_appbuilder import expose
from flask_appbuilder.security.decorators import has_access_api
from flask_babel import gettext as __

from superset import appbuilder, db
from superset.connectors.connector_registry import ConnectorRegistry
from superset.models.core import Database
from .base import BaseSupersetView, check_ownership, json_error_response
from .base import BaseSupersetView, json_error_response


class Datasource(BaseSupersetView):
Expand All @@ -39,14 +38,6 @@ def save(self):
orm_datasource = ConnectorRegistry.get_datasource(
datasource_type, datasource_id, db.session)

if not check_ownership(orm_datasource, raise_if_false=False):
return json_error_response(
__(
'You are not authorized to modify '
'this data source configuration'),
status='401',
)

if 'owners' in datasource:
datasource['owners'] = db.session.query(orm_datasource.owner_class).filter(
orm_datasource.owner_class.id.in_(datasource['owners'])).all()
Expand Down

0 comments on commit c771625

Please sign in to comment.