Skip to content

Commit

Permalink
History view always include registration.ownLand. (#1966)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Jul 5, 2024
1 parent 5757de4 commit 6fc2927
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mhr_api/src/mhr_api/models/registration_history_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mhr_api/src/mhr_api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '1.8.15' # pylint: disable=invalid-name
__version__ = '1.8.16' # pylint: disable=invalid-name
6 changes: 6 additions & 0 deletions mhr_api/tests/unit/models/test_registration_history_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 6fc2927

Please sign in to comment.