Skip to content
Snippets Groups Projects
Commit 14680ba3 authored by Carlos Vega's avatar Carlos Vega
Browse files

avoid provenance update if new_value and old_value are equal

parent 36e19aca
No related branches found
No related tags found
1 merge request!249More provenance #328
Pipeline #25547 passed
......@@ -96,6 +96,8 @@ class TnsCsvVisitImportReader:
for field, new_value in changes:
old_value = getattr(visit, field)
if old_value == new_value:
continue
description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value)
p = Provenance(modified_table=Visit._meta.db_table,
modified_table_id=visit.id,
......@@ -143,6 +145,8 @@ class TnsCsvVisitImportReader:
for field, new_value in changes:
old_value = getattr(appointment, field)
if old_value == new_value:
continue
description = u'{} changed from "{}" to "{}"'.format(field, old_value, new_value)
p = Provenance(modified_table=Appointment._meta.db_table,
modified_table_id=appointment.id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment