Skip to content

Commit

Permalink
20327 Fix error occurred when testing filer on GCP for registration -…
Browse files Browse the repository at this point in the history
… part 2 (bcgov#2560)

* 20327-fix3

Signed-off-by: Hongjing Chen <[email protected]>

* update

Signed-off-by: Hongjing Chen <[email protected]>

* remove saving party

Signed-off-by: Hongjing Chen <[email protected]>

* replace transaction_id with completion_date to trigger filing status update

Signed-off-by: Hongjing Chen <[email protected]>

* fix as per failed unit tests

Signed-off-by: Hongjing Chen <[email protected]>

---------

Signed-off-by: Hongjing Chen <[email protected]>
  • Loading branch information
chenhongjing authored Apr 3, 2024
1 parent abc2743 commit c485659
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion legal-api/src/legal_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def receive_before_change(mapper, connection, target): # pylint: disable=unused
# changes are part of the class and are not externalized
if filing.filing_type == "lear_epoch":
filing._status = Filing.Status.EPOCH.value # pylint: disable=protected-access
elif filing.transaction_id:
elif filing.completion_date:
filing._status = Filing.Status.COMPLETED.value # pylint: disable=protected-access
elif filing.payment_completion_date or filing.source == Filing.Source.COLIN.value:
filing._status = Filing.Status.PAID.value # pylint: disable=protected-access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ def receive_before_change(mapper, connection, target): # pylint: disable=unused
# changes are part of the class and are not externalized
if filing.filing_type == "lear_epoch":
filing._status = Filing.Status.EPOCH.value # pylint: disable=protected-access
elif filing.transaction_id:
elif filing.completion_date:
filing._status = Filing.Status.COMPLETED.value # pylint: disable=protected-access
elif filing.payment_completion_date or filing.source == Filing.Source.COLIN.value:
filing._status = Filing.Status.PAID.value # pylint: disable=protected-access
Expand Down
30 changes: 15 additions & 15 deletions queue_services/entity-filer/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def merge_all_parties(legal_entity: LegalEntity, filing: Filing, parties: dict)
) or (
(not party_identifier)
and (party_id := party_dict.get("officer", {}).get("id"))
and (isinstance(party_id, int) or party_id.isnumeric())
and ((party_le := LegalEntity.find_by_id(party_id)) or (party_le := ColinEntity.find_by_id(party_id)))
):
existing_party = True
Expand Down Expand Up @@ -422,7 +423,6 @@ def create_entity_with_addresses(party_dict) -> LegalEntity:
else:
new_party.delivery_address = delivery_address

new_party.save()
return new_party


Expand Down Expand Up @@ -481,6 +481,7 @@ def get_or_create_party(party_dict: dict, filing: Filing):
) or (
(not party_identifier)
and (party_id := party_dict.get("officer", {}).get("id"))
and (isinstance(party_id, int) or party_id.isnumeric())
and ((party_le := LegalEntity.find_by_id(party_id)) or (party_le := ColinEntity.find_by_id(party_id)))
):
existing_party = True
Expand Down

0 comments on commit c485659

Please sign in to comment.