EnxDev commented on code in PR #42472:
URL: https://github.com/apache/superset/pull/42472#discussion_r3658309963
##########
superset/models/helpers.py:
##########
@@ -664,6 +667,12 @@ def reset_ownership(self) -> None:
user_subject = get_user_subject(g.user.id)
if user_subject:
self.editors = [user_subject]
+ # Only dashboards and charts have ``viewers``; this mixin also
+ # serves datasets, which have editors only. Defaults never replace
+ # viewers already present on the instance, matching the create
+ # commands' "explicit viewers win" rule.
+ if hasattr(self, "viewers") and not self.viewers: # type:
ignore[has-type]
Review Comment:
reset_ownership is reached only by the v0 importers
(commands/dashboard/importers/v0.py:67,240), never the create path — the
reproduction ("create through the PR's asset-creation paths → invokes
reset_ownership") doesn't hold. The paths that do accept a viewers payload go
through populate_subjects, which already distinguishes an explicit empty list
(if properties.get("viewers") is not None) and honors viewers=[] by assigning
no defaults. v0 imports don't carry viewers, so there's no explicit-empty
intent for not self.viewers to misread.
--
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]