Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions colin-api/src/colin_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2045,12 +2045,12 @@ def generate_numbered_legal_name(cls, legal_type, identifier):
def _process_share_structure(cls, cursor, filing: Filing, corp_num: str):
"""Process share structure."""
if share_structure := filing.body.get('shareStructure', None):
for date_str in share_structure.get('resolutionDates', []):
for resolution_date in share_structure.get('resolutionDates', []):
Business.create_resolution(
cursor=cursor,
corp_num=corp_num,
event_id=filing.event_id,
resolution_date=date_str
resolution_date=resolution_date['date'] if isinstance(resolution_date, dict) else resolution_date
)

if filing.business.corp_type != Business.TypeCodes.COOP.value and \
Expand Down Expand Up @@ -2155,7 +2155,8 @@ def _process_share_correction(cls, cursor, filing: Filing, corp_num: str, filing
)

old_resolution_dates = Business.get_resolutions(cursor, corp_num)
for date_str in share_structure.get('resolutionDates', []):
for resolution_date in share_structure.get('resolutionDates', []):
date_str = resolution_date['date'] if isinstance(resolution_date, dict) else resolution_date
if date_str not in old_resolution_dates: # new resolution date
Business.create_resolution(
cursor=cursor,
Expand All @@ -2167,8 +2168,8 @@ def _process_share_correction(cls, cursor, filing: Filing, corp_num: str, filing
old_resolution_dates.remove(date_str)

if old_resolution_dates: # remove deleted resolution dates
for resoultion_date in old_resolution_dates:
Business.end_resolution(cursor, corp_num, filing.event_id, resoultion_date)
for resolution_date in old_resolution_dates:
Business.end_resolution(cursor, corp_num, filing.event_id, resolution_date)

return filing.event_id

Expand Down
2 changes: 1 addition & 1 deletion colin-api/src/colin_api/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '2.172.4' # pylint: disable=invalid-name
__version__ = '2.172.5' # pylint: disable=invalid-name
Loading