Skip to content

Commit

Permalink
Merge pull request #1281 from bcgov/dev-NC-FOIMOD-3708
Browse files Browse the repository at this point in the history
Corrected sorting for sections FOIMOD-3708
  • Loading branch information
nagarajaPC-AOT authored Jan 23, 2025
2 parents 6a7a169 + 095d4fe commit 8d60b60
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@ def generate_text(self, range_result):
# Format the section information
formatted_sections = f"{pageflag} under {sections_str}" if sections_str else ""
# Append the formatted text to the section list
section_list.append({"formatted" :f"pg(s). {range_item} {formatted_sections}" if formatted_sections else range_item})
return section_list
section_list.append({"formatted" :f"pg(s). {range_item} {formatted_sections}" if formatted_sections else range_item,
"page_no": self.__getrangenumber(range_item) if '-' in range_item else int(range_item)})

section_list.sort(key=lambda x: x['page_no'])
formatted_section_list = [{"formatted":item['formatted']} for item in section_list]
return formatted_section_list


def __getredactionlayerid(self, message):
Expand Down

0 comments on commit 8d60b60

Please sign in to comment.