mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-14 07:12:19 +00:00
fix: non LDAP user group can't be updated after update
This commit is contained in:
@@ -89,7 +89,6 @@ func (s *UserGroupService) Update(id string, input dto.UserGroupCreateDto, allow
|
|||||||
|
|
||||||
group.Name = input.Name
|
group.Name = input.Name
|
||||||
group.FriendlyName = input.FriendlyName
|
group.FriendlyName = input.FriendlyName
|
||||||
group.LdapID = &input.LdapID
|
|
||||||
|
|
||||||
if err := s.db.Preload("Users").Save(&group).Error; err != nil {
|
if err := s.db.Preload("Users").Save(&group).Error; err != nil {
|
||||||
if errors.Is(err, gorm.ErrDuplicatedKey) {
|
if errors.Is(err, gorm.ErrDuplicatedKey) {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
UPDATE user_groups SET ldap_id = '' WHERE ldap_id IS NULL;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
UPDATE user_groups SET ldap_id = null WHERE ldap_id = '';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
UPDATE user_groups SET ldap_id = '' WHERE ldap_id IS NULL;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
UPDATE user_groups SET ldap_id = null WHERE ldap_id = '';
|
||||||
Reference in New Issue
Block a user