EnxDev commented on code in PR #42472:
URL: https://github.com/apache/superset/pull/42472#discussion_r3656974437
##########
superset/commands/chart/importers/v1/utils.py:
##########
@@ -202,11 +202,17 @@ def import_chart(
db.session.flush()
if user:
- from superset.subjects.utils import get_user_subject
+ from superset.subjects.utils import (
+ get_default_viewers_for_new_asset,
+ get_user_subject,
+ )
subj = get_user_subject(user.id)
if subj and subj not in chart.editors:
chart.editors.append(subj)
+ for viewer in get_default_viewers_for_new_asset(user.id):
Review Comment:
Agreed; done exactly as suggested. Changed to if not existing and user: so
the block runs only for newly-created charts, mirroring the dashboard importer.
_prepare_existing_chart_for_import returns None on both the overwrite and
restore paths as you noted, so those now correctly skip the
default-viewer/editor attachment. Regression test added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]