diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6fdfaf1..54c5f7c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,8 @@
-
+
-
-
@@ -161,7 +159,6 @@
-
@@ -186,7 +183,8 @@
-
+
+
diff --git a/pkg/internal/services/realms.go b/pkg/internal/services/realms.go
index 75117d2..3207c9a 100644
--- a/pkg/internal/services/realms.go
+++ b/pkg/internal/services/realms.go
@@ -115,7 +115,7 @@ func AddRealmMember(user models.Account, affected models.Account, target models.
if err := database.C.Where(&models.RealmMember{
AccountID: affected.ID,
RealmID: target.ID,
- }).First(&member).Error; err == nil || errors.Is(err, gorm.ErrRecordNotFound) {
+ }).First(&member).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
return fmt.Errorf("the user is already in the realm")
}