fix(changes): decide if human or machine modifier (#953)

This commit is contained in:
Silvan
2020-11-12 17:01:30 +01:00
committed by GitHub
parent b5a7263124
commit 966e3850ed
5 changed files with 34 additions and 7 deletions

View File

@@ -299,7 +299,12 @@ func (repo *ProjectRepo) ProjectChanges(ctx context.Context, id string, lastSequ
change.ModifierName = change.ModifierId
user, _ := repo.UserEvents.UserByID(ctx, change.ModifierId)
if user != nil {
change.ModifierName = user.DisplayName
if user.Human != nil {
change.ModifierName = user.DisplayName
}
if user.Machine != nil {
change.ModifierName = user.Machine.Name
}
}
}
return changes, nil
@@ -389,7 +394,12 @@ func (repo *ProjectRepo) ApplicationChanges(ctx context.Context, id string, appI
change.ModifierName = change.ModifierId
user, _ := repo.UserEvents.UserByID(ctx, change.ModifierId)
if user != nil {
change.ModifierName = user.DisplayName
if user.Human != nil {
change.ModifierName = user.DisplayName
}
if user.Machine != nil {
change.ModifierName = user.Machine.Name
}
}
}
return changes, nil