This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 84970ba615 [SYNCOPE-1752] Proper realm setting for self-edit via 
Enduser
84970ba615 is described below

commit 84970ba61569323c844504b9bf34697de844f983
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Mon May 22 13:59:28 2023 +0200

    [SYNCOPE-1752] Proper realm setting for self-edit via Enduser
---
 .../org/apache/syncope/client/enduser/panels/any/UserDetails.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/panels/any/UserDetails.java
 
b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/panels/any/UserDetails.java
index debec15dea..4e2a566db1 100644
--- 
a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/panels/any/UserDetails.java
+++ 
b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/panels/any/UserDetails.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.enduser.panels.any;
 
 import 
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.password.strength.PasswordStrengthBehavior;
 import java.util.List;
+import java.util.Optional;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.ui.commons.ajax.markup.html.LabelInfo;
 import 
org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
@@ -72,7 +73,8 @@ public class UserDetails extends Details<UserTO> {
         AjaxDropDownChoicePanel<String> destinationRealm = new 
AjaxDropDownChoicePanel<>(
                 "destinationRealm", "destinationRealm", new 
PropertyModel<>(userTO, "realm"), false);
         destinationRealm.setNullValid(false);
-        destinationRealm.setChoices(List.of(SyncopeConstants.ROOT_REALM));
+        destinationRealm.setChoices(List.of(
+                
Optional.ofNullable(userTO.getRealm()).orElse(SyncopeConstants.ROOT_REALM)));
         return destinationRealm;
     }
 

Reply via email to