Skip to content

Commit

Permalink
Minor : Fix #18606 prevent overwriting style for PUT request (#18864)
Browse files Browse the repository at this point in the history
* Minor : Fix 18606 prevent overwriting domain for PUT request

* load the attributes of glossaryTerm first and override with the import

* change logging to warn type

* revert changes

---------

Co-authored-by: Sriharsha Chintalapani <[email protected]>
  • Loading branch information
sonika-shah and harshach committed Jan 5, 2025
1 parent 7c5584e commit 35b281f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
import org.openmetadata.schema.entity.feed.Suggestion;
import org.openmetadata.schema.entity.teams.Team;
import org.openmetadata.schema.entity.teams.User;
import org.openmetadata.schema.entity.type.Style;
import org.openmetadata.schema.system.EntityError;
import org.openmetadata.schema.type.ApiStatus;
import org.openmetadata.schema.type.AssetCertification;
Expand Down Expand Up @@ -2969,6 +2970,14 @@ private static List<EntityReference> getEntityReferences(List<EntityReference> r

private void updateStyle() {
if (supportsStyle) {
Style originalStyle = original.getStyle();
Style updatedStyle = updated.getStyle();

if (originalStyle == updatedStyle) return;
if (operation == Operation.PUT && updatedStyle == null) {
updatedStyle = originalStyle;
updated.setStyle(updatedStyle);
}
recordChange(FIELD_STYLE, original.getStyle(), updated.getStyle(), true);
}
}
Expand Down

0 comments on commit 35b281f

Please sign in to comment.