Fix saving user scopes (#66)
This commit is contained in:
parent
720ecb8788
commit
0f83486593
|
|
@ -28,7 +28,6 @@ class ScopeEntity : BaseEntity() {
|
|||
|
||||
fun addUsers(users: Collection<UserEntity>) {
|
||||
this.users.addAll(users)
|
||||
users.forEach { it.scopes.add(this) }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ class UserEntity : AuditableUuidIdEntity() {
|
|||
|
||||
fun addScopes(scopes: Collection<ScopeEntity>) {
|
||||
this.scopes.addAll(scopes)
|
||||
scopes.forEach { it.users.add(this) }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -398,7 +398,10 @@ internal class UserCoreServiceImplSlowTest {
|
|||
userId = regUser.id,
|
||||
scopes = newScopes
|
||||
)
|
||||
)
|
||||
).also {
|
||||
entityManager.flush()
|
||||
entityManager.clear()
|
||||
}
|
||||
|
||||
val actualUser = userRepository.findByIdOrThrow(regUser.id)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue