rusackas commented on code in PR #43666:
URL: https://github.com/apache/superset/pull/43666#discussion_r4018196572
##########
superset/commands/dashboard/update.py:
##########
@@ -131,6 +132,19 @@ def validate(self) -> None:
except ValidationError as ex:
exceptions.append(ex)
+ # A dashboard PUT resends the full object on every save, so only
+ # validate css when it's actually changing -- otherwise a dashboard
+ # whose existing css predates this check (or was imported without
+ # going through it) becomes uneditable for unrelated changes like a
+ # rename or a chart move.
+ if "css" in self._properties:
+ new_css = self._properties["css"]
+ if new_css != self._model.css:
+ try:
+ validate_css(new_css)
Review Comment:
Fixed, css errors come back keyed under "css" again instead of "_schema".
Status stayed 422 though, thats the existing convention for command-level
validation (slug uniqueness does the same), didnt want to special-case just
this one field.
--
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]