From 6fc292765849eac742edda4d3e5021740e02fb28 Mon Sep 17 00:00:00 2001 From: Doug Lovett Date: Fri, 5 Jul 2024 09:12:11 -0700 Subject: [PATCH] History view always include registration.ownLand. (#1966) Signed-off-by: Doug Lovett --- mhr_api/src/mhr_api/models/registration_history_utils.py | 5 ++--- mhr_api/src/mhr_api/version.py | 2 +- .../tests/unit/models/test_registration_history_utils.py | 6 ++++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mhr_api/src/mhr_api/models/registration_history_utils.py b/mhr_api/src/mhr_api/models/registration_history_utils.py index 354a6e92b..5292be8fb 100644 --- a/mhr_api/src/mhr_api/models/registration_history_utils.py +++ b/mhr_api/src/mhr_api/models/registration_history_utils.py @@ -203,7 +203,8 @@ def get_reg_summary_json(registration: MhrRegistration) -> dict: 'createDateTime': model_utils.format_ts(registration.registration_ts), 'registrationDescription': get_document_description(doc.document_type), 'documentId': doc.document_id, - 'documentRegistrationNumber': doc.document_registration_number + 'documentRegistrationNumber': doc.document_registration_number, + 'ownLand': doc.own_land == 'Y' } if doc.attention_reference: reg_json['attentionReference'] = doc.attention_reference @@ -214,8 +215,6 @@ def get_reg_summary_json(registration: MhrRegistration) -> dict: reg_json['declaredValue'] = doc.declared_value if doc.consideration_value: reg_json['consideration'] = doc.consideration_value - if doc.own_land: - reg_json['ownLand'] = doc.own_land == 'Y' if doc.transfer_date: reg_json['transferDate'] = model_utils.format_ts(doc.transfer_date) return reg_json diff --git a/mhr_api/src/mhr_api/version.py b/mhr_api/src/mhr_api/version.py index 9a59b42d7..49647dd28 100644 --- a/mhr_api/src/mhr_api/version.py +++ b/mhr_api/src/mhr_api/version.py @@ -22,4 +22,4 @@ Development release segment: .devN """ -__version__ = '1.8.15' # pylint: disable=invalid-name +__version__ = '1.8.16' # pylint: disable=invalid-name diff --git a/mhr_api/tests/unit/models/test_registration_history_utils.py b/mhr_api/tests/unit/models/test_registration_history_utils.py index e186bf56f..71884c766 100644 --- a/mhr_api/tests/unit/models/test_registration_history_utils.py +++ b/mhr_api/tests/unit/models/test_registration_history_utils.py @@ -47,6 +47,12 @@ def test_get_home_history(session, mhr_num, reg_view, reg_status, reg_count, not assert history_json.get('registrations') assert len(history_json['registrations']) == reg_count if not reg_view: + for reg in history_json.get('registrations'): + assert 'ownLand' in reg + assert reg.get('createDateTime') + assert reg.get('registrationDescription') + assert reg.get('documentId') + assert reg.get('documentRegistrationNumber') assert history_json.get('descriptions') assert history_json.get('locations') assert history_json.get('owners')