People: Reset related fields when clearing marker subject #22

This commit is contained in:
Michael Mayer 2021-08-21 17:11:02 +02:00
parent d88d9b3781
commit acde5c2dae
2 changed files with 20 additions and 0 deletions

View file

@ -277,7 +277,11 @@ func (m *Marker) ClearSubject(src string) (err error) {
return err
}
m.MarkerName = ""
m.FaceID = ""
m.Face = nil
m.SubjectUID = ""
m.SubjectSrc = ""
return nil
}

View file

@ -132,3 +132,19 @@ func TestMarker_Save(t *testing.T) {
t.Logf("FILES: %#v", p.Files)
})
}
func TestMarker_ClearSubject(t *testing.T) {
t.Run("1000003-2", func(t *testing.T) {
m := MarkerFixtures.Get("1000003-2")
assert.NotEmpty(t, m.MarkerName)
err := m.ClearSubject(SrcAuto)
if err != nil {
t.Fatal(err)
}
assert.Empty(t, m.MarkerName)
})
}