Skip to content

Commit fa6a7e2

Browse files
committed
feat(cases): enhance logging for classification ID changes during case updates
1 parent e611faf commit fa6a7e2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

source/app/business/cases.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ def cases_update(case: Cases, updated_case, protagonists, tags,
220220
register_case_protagonists(updated_case.case_id, protagonists)
221221
save_case_tags(tags, case)
222222

223+
logger.debug(f'Classification check: prev={previous_classification_id} '
224+
f'new={updated_case.classification_id} '
225+
f'same_obj={case is updated_case} '
226+
f'classification_in_req=unknown')
223227
if previous_classification_id != updated_case.classification_id:
228+
logger.debug('Classification DETECTED change, writing history entry')
224229
add_obj_history_entry(
225230
case,
226231
f'classification_id from "{previous_classification_id}" to "{updated_case.classification_id}"'
@@ -230,6 +235,7 @@ def cases_update(case: Cases, updated_case, protagonists, tags,
230235
f'to {updated_case.classification_id}',
231236
caseid=case.case_id
232237
)
238+
logger.debug('Classification history entry written')
233239

234240
updated_case = call_modules_hook('on_postload_case_update', data=updated_case, caseid=case.case_id)
235241

0 commit comments

Comments
 (0)