amitNielsen commented on a change in pull request #10594:
URL: 
https://github.com/apache/incubator-superset/pull/10594#discussion_r475829539



##########
File path: superset/models/dashboard.py
##########
@@ -496,3 +548,13 @@ def event_after_dashboard_changed(  # pylint: 
disable=unused-argument
 if is_feature_enabled("THUMBNAILS_SQLA_LISTENERS"):
     sqla.event.listen(Dashboard, "after_insert", event_after_dashboard_changed)
     sqla.event.listen(Dashboard, "after_update", event_after_dashboard_changed)
+
+
+sqla.event.listen(Dashboard, "after_insert", SecuredMixin.after_insert)

Review comment:
       @villebro @dpgaspar @altef @john-bodley 
   Hey,
   
   we wanted to create the matching permission when a dashboard gets created so 
we did the same as was done for `datasource`
   
   we are experiencing an issue where after adding the **after_insert** even 
listening some existing tests are failing (different ones on different 
databases)
   
   it seems like some of the parameters like (created_by) are not being fetched 
from the databases after a dashboard is created
   
   if we debug the test and adding a manual `session.commit()` after dashboard 
creation and before fetching the dashboard again so only then the created_by 
gets updates
   
   Do you have any idea how should we address this?
   is there another strategy that we should take when implementing such a 
behavior?
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to