mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-17 03:38:18 +00:00
[FIX] EmailTemplates Edit Configurations. (#17581)
* added migration for emailTemplates. * PUT will set the old template in the db.[walkaround] * remove migration.
This commit is contained in:
parent
9641033d5d
commit
a2c77b08b7
@ -141,6 +141,21 @@ public class SystemRepository {
|
|||||||
@Transaction
|
@Transaction
|
||||||
public Response createOrUpdate(Settings setting) {
|
public Response createOrUpdate(Settings setting) {
|
||||||
Settings oldValue = getConfigWithKey(setting.getConfigType().toString());
|
Settings oldValue = getConfigWithKey(setting.getConfigType().toString());
|
||||||
|
|
||||||
|
if (oldValue != null && oldValue.getConfigType().equals(SettingsType.EMAIL_CONFIGURATION)) {
|
||||||
|
SmtpSettings configValue =
|
||||||
|
JsonUtils.convertValue(oldValue.getConfigValue(), SmtpSettings.class);
|
||||||
|
if (configValue != null) {
|
||||||
|
SmtpSettings.Templates templates = configValue.getTemplates();
|
||||||
|
SmtpSettings newConfigValue =
|
||||||
|
JsonUtils.convertValue(setting.getConfigValue(), SmtpSettings.class);
|
||||||
|
if (newConfigValue != null) {
|
||||||
|
newConfigValue.setTemplates(templates);
|
||||||
|
setting.setConfigValue(newConfigValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
updateSetting(setting);
|
updateSetting(setting);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user