first pass at keeping overrides on face delete - should at least stop code crashing if you try to delete faces from DB and they still had a matching override

This commit is contained in:
2022-07-28 21:23:34 +10:00
parent 96810fa1e3
commit 391b61f3c4
5 changed files with 135 additions and 16 deletions

View File

@@ -348,7 +348,7 @@ def override_force_match():
if not f:
raise Exception("could not find face to add override for!")
mo = FaceManualOverride( face_id=f.id, face=f.face, person_id=p.id )
mo = FaceManualOverride( face_id=f.id, person_id=p.id )
db.session.add( mo )
db.session.commit()
@@ -410,7 +410,7 @@ def add_no_match_override():
if not t:
raise Exception("could not find override_type to add override for!")
nmo = FaceNoMatchOverride( face_id=f.id, face=f.face, type_id=t.id )
nmo = FaceNoMatchOverride( face_id=f.id, type_id=t.id )
db.session.add( nmo )
db.session.commit()