Fix saving user scopes (#66)

This commit is contained in:
Mikhail Yasnov 2022-02-08 18:40:46 +03:00 committed by GitHub
parent 720ecb8788
commit 0f83486593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -28,7 +28,6 @@ class ScopeEntity : BaseEntity() {
fun addUsers(users: Collection<UserEntity>) {
this.users.addAll(users)
users.forEach { it.scopes.add(this) }
}
}

View File

@ -39,7 +39,6 @@ class UserEntity : AuditableUuidIdEntity() {
fun addScopes(scopes: Collection<ScopeEntity>) {
this.scopes.addAll(scopes)
scopes.forEach { it.users.add(this) }
}
}

View File

@ -398,7 +398,10 @@ internal class UserCoreServiceImplSlowTest {
userId = regUser.id,
scopes = newScopes
)
)
).also {
entityManager.flush()
entityManager.clear()
}
val actualUser = userRepository.findByIdOrThrow(regUser.id)