fix: handle domain claimed event correctly for service users (#1711)

* fix: handle domain claimed event correctly on user view

* fix: ignore domain claimed events for email notifications

* fix: change org

* handle org changed in read models correctly

* fix: change org in user grant handler

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz
2021-05-04 14:57:11 +02:00
committed by GitHub
parent 87c1dfa3aa
commit bc633627c4
10 changed files with 60 additions and 24 deletions

View File

@@ -274,10 +274,14 @@ func (u *UserView) AppendEvent(event *models.Event) (err error) {
es_model.MachineChanged:
err = u.setData(event)
case es_model.DomainClaimed:
u.UsernameChangeRequired = true
if u.HumanView != nil {
u.HumanView.UsernameChangeRequired = true
}
err = u.setData(event)
case es_model.UserUserNameChanged:
u.UsernameChangeRequired = false
if u.HumanView != nil {
u.HumanView.UsernameChangeRequired = false
}
err = u.setData(event)
case es_model.UserEmailChanged,
es_model.HumanEmailChanged: