Skip to content

Commit

Permalink
MHR API bug fixes remove registration, permit move back to BC. (#2029)
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Lovett <[email protected]>
  • Loading branch information
doug-lovett authored Oct 1, 2024
1 parent 9041fb8 commit 51527ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mhr_api/src/mhr_api/models/mhr_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def save_permit(self, json_data, new_reg_id):
json_data.get('location') and json_data['location']['address']['region'] == model_utils.PROVINCE_BC:
self.status_type = MhrRegistrationStatusTypes.ACTIVE
current_app.logger.info('Cancel Transport Permit new location in BC, updating EXEMPT status to ACTIVE.')
elif json_data and json_data.get('documentType') == MhrDocumentTypes.AMEND_PERMIT and \
elif json_data and json_data.get('amendment') and \
self.status_type == MhrRegistrationStatusTypes.EXEMPT and \
json_data['newLocation']['address']['region'] == model_utils.PROVINCE_BC:
self.status_type = MhrRegistrationStatusTypes.ACTIVE
Expand Down
8 changes: 6 additions & 2 deletions mhr_api/src/mhr_api/models/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@
SELECT DISTINCT mr.mhr_number
FROM mhr_registrations mr
WHERE account_id = :query_value1
AND mr.registration_type IN ('MHREG', 'MHREG_CONVERSION')))
AND mr.registration_type IN ('MHREG', 'MHREG_CONVERSION')
AND NOT EXISTS (SELECT mer.id
FROM mhr_extra_registrations mer
WHERE mer.account_id = mr.account_id
AND mer.mhr_number = mr.mhr_number
AND mer.removed_ind = 'Y')))
"""

REG_ORDER_BY_DATE = ' ORDER BY registration_ts DESC'
REG_ORDER_BY_MHR_NUMBER = ' ORDER BY mhr_number'
REG_ORDER_BY_REG_TYPE = ' ORDER BY document_type'
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.23' # pylint: disable=invalid-name
__version__ = '1.8.24' # pylint: disable=invalid-name

0 comments on commit 51527ce

Please sign in to comment.