fix: 🐛 Allow Group description to be empty string
parent
3f4a70969b
commit
76899b4477
|
@ -60,8 +60,8 @@ public class Group extends Model {
|
|||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
if (Strings.isNullOrEmpty(description)) {
|
||||
throw new IllegalArgumentException("description cannot be null nor empty");
|
||||
if (null == description) {
|
||||
throw new IllegalArgumentException("description cannot be null");
|
||||
}
|
||||
|
||||
this.description = description;
|
||||
|
|
|
@ -114,7 +114,7 @@ public class RpcMapper {
|
|||
|
||||
Long id = getRequiredFieldAsLong(json, ID);
|
||||
Long parentGroupId = getFieldAsLong(json, PARENT_GROUP_ID);
|
||||
String name = getRequiredFieldAsString(json, NAME);
|
||||
String name = getFieldAsString(json, NAME);
|
||||
String description = getFieldAsString(json, DESCRIPTION);
|
||||
Long voId = getRequiredFieldAsLong(json, VO_ID);
|
||||
String uuid = getRequiredFieldAsString(json, UUID);
|
||||
|
|
|
@ -557,15 +557,18 @@ public class PerunAdapterLdap extends PerunAdapterWithMappingServices implements
|
|||
PERUN_VO_ID, PERUN_PARENT_GROUP_ID, UUID};
|
||||
|
||||
EntryMapper<Group> mapper = e -> {
|
||||
if (!checkHasAttributes(e, new String[]{
|
||||
PERUN_GROUP_ID, CN, DESCRIPTION, PERUN_UNIQUE_GROUP_NAME, PERUN_VO_ID, UUID }))
|
||||
if (!checkHasAttributes(e,
|
||||
new String[]{ PERUN_GROUP_ID, CN, PERUN_UNIQUE_GROUP_NAME, PERUN_VO_ID, UUID }))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Long id = Long.valueOf(e.get(PERUN_GROUP_ID).getString());
|
||||
String name = e.get(CN).getString();
|
||||
String description = e.get(DESCRIPTION).getString();
|
||||
String description = "";
|
||||
if (e.containsAttribute(DESCRIPTION)) {
|
||||
description = e.get(DESCRIPTION).getString();
|
||||
}
|
||||
String uniqueName = e.get(PERUN_UNIQUE_GROUP_NAME).getString();
|
||||
Long voId = Long.valueOf(e.get(PERUN_VO_ID).getString());
|
||||
Long parentGroupId = null;
|
||||
|
|
Loading…
Reference in New Issue