diff --git a/api/well_inventory.py b/api/well_inventory.py index 1d19ae581..90c6e0300 100644 --- a/api/well_inventory.py +++ b/api/well_inventory.py @@ -87,7 +87,7 @@ def _make_contact(model: WellInventoryRow, well: Thing, idx) -> dict: notes = [] for content, note_type in ( (model.result_communication_preference, "Communication"), - (model.contact_special_instructions, "General"), + (model.contact_special_requests_notes, "General"), ): if content is not None: notes.append({"content": content, "note_type": note_type}) @@ -509,7 +509,7 @@ def _add_csv_row(session: Session, group: Group, model: WellInventoryRow, user) (model.special_requests, "General"), (model.well_measuring_notes, "Sampling Procedure"), (model.sampling_scenario_notes, "Sampling Procedure"), - (historic_depth_note, "Historic"), + (historic_depth_note, "Historical"), ): if note_content is not None: well_notes.append({"content": note_content, "note_type": note_type}) @@ -563,7 +563,6 @@ def _add_csv_row(session: Session, group: Group, model: WellInventoryRow, user) ) well_data = data.model_dump( exclude=[ - "well_purposes", "well_casing_materials", ] ) diff --git a/services/contact_helper.py b/services/contact_helper.py index 5c5245683..5e9766be9 100644 --- a/services/contact_helper.py +++ b/services/contact_helper.py @@ -98,13 +98,12 @@ def add_contact(session: Session, data: CreateContact | dict, user: dict) -> Con session.flush() session.refresh(contact) if thing_id is not None: - location_contact_association = ThingContactAssociation() - location_contact_association.thing_id = thing_id - location_contact_association.contact_id = contact.id + thing_contact_association = ThingContactAssociation() + thing_contact_association.thing_id = thing_id + thing_contact_association.contact_id = contact.id - audit_add(user, location_contact_association) - - session.add(location_contact_association) + audit_add(user, thing_contact_association) + session.add(thing_contact_association) session.flush() session.commit()