fix: non LDAP user group can't be updated after update

This commit is contained in:
Elias Schneider
2025-02-03 08:37:46 +01:00
parent 2d3cba6308
commit ecd74b794f
9 changed files with 4 additions and 1 deletions

View File

@@ -89,7 +89,6 @@ func (s *UserGroupService) Update(id string, input dto.UserGroupCreateDto, allow
group.Name = input.Name
group.FriendlyName = input.FriendlyName
group.LdapID = &input.LdapID
if err := s.db.Preload("Users").Save(&group).Error; err != nil {
if errors.Is(err, gorm.ErrDuplicatedKey) {

View File

@@ -0,0 +1 @@
UPDATE user_groups SET ldap_id = '' WHERE ldap_id IS NULL;

View File

@@ -0,0 +1 @@
UPDATE user_groups SET ldap_id = null WHERE ldap_id = '';

View File

@@ -0,0 +1 @@
UPDATE user_groups SET ldap_id = '' WHERE ldap_id IS NULL;

View File

@@ -0,0 +1 @@
UPDATE user_groups SET ldap_id = null WHERE ldap_id = '';