dpgaspar commented on a change in pull request #9418: [mypy] Enforcing typing 
for superset.dashboards
URL: 
https://github.com/apache/incubator-superset/pull/9418#discussion_r401655907
 
 

 ##########
 File path: superset/dashboards/api.py
 ##########
 @@ -161,7 +162,9 @@ def post(self) -> Response:
             return self.response_400(message=item.errors)
         try:
             new_model = CreateDashboardCommand(g.user, item.data).run()
-            return self.response(201, id=new_model.id, result=item.data)
+            if new_model:
+                return self.response(201, id=new_model.id, result=item.data)
+            raise DashboardCreateFailedError()
 
 Review comment:
   "side effect" for having coherent typing

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


With regards,
Apache Git Services

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

Reply via email to