mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
Make owner a m2m relation on datasources (#6544)
* Make owner a m2m relation on datasources * Fix pylint * Make migration work in mysql & sqlite
This commit is contained in:
committed by
Maxime Beauchemin
parent
6a95f8070a
commit
fd0338614a
@@ -29,6 +29,10 @@ class Datasource(BaseSupersetView):
|
||||
'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()
|
||||
orm_datasource.update_from_object(datasource)
|
||||
data = orm_datasource.data
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user