accrual: Aging report uses RT short links for all RT link text.
Per user request. This is better than saying "Display.html" everywhere.
This commit is contained in:
parent
4ca188611f
commit
d6559b572f
1 changed files with 6 additions and 10 deletions
|
@ -390,20 +390,16 @@ class AgingODS(core.BaseODS[AccrualPostings, Optional[data.Account]]):
|
||||||
|
|
||||||
def _link_seq(self, row: AccrualPostings, key: MetaKey) -> Iterator[Tuple[str, str]]:
|
def _link_seq(self, row: AccrualPostings, key: MetaKey) -> Iterator[Tuple[str, str]]:
|
||||||
for href in row.all_meta_links(key):
|
for href in row.all_meta_links(key):
|
||||||
text: Optional[str] = None
|
|
||||||
rt_ids = self.rt_wrapper.parse(href)
|
rt_ids = self.rt_wrapper.parse(href)
|
||||||
if rt_ids is not None:
|
rt_href = rt_ids and self.rt_wrapper.url(*rt_ids)
|
||||||
ticket_id, attachment_id = rt_ids
|
if rt_ids is None or rt_href is None:
|
||||||
if attachment_id is None:
|
|
||||||
text = f'RT#{ticket_id}'
|
|
||||||
href = self.rt_wrapper.url(ticket_id, attachment_id) or href
|
|
||||||
else:
|
|
||||||
# '..' pops the ODS filename off the link path. In other words,
|
# '..' pops the ODS filename off the link path. In other words,
|
||||||
# make the link relative to the directory the ODS is in.
|
# make the link relative to the directory the ODS is in.
|
||||||
href = f'../{href}'
|
href_path = Path('..', urlparse.urlparse(href).path)
|
||||||
if text is None:
|
href = str(href_path)
|
||||||
href_path = Path(urlparse.urlparse(href).path)
|
|
||||||
text = urlparse.unquote(href_path.name)
|
text = urlparse.unquote(href_path.name)
|
||||||
|
else:
|
||||||
|
text = self.rt_wrapper.unparse(*rt_ids)
|
||||||
yield (href, text)
|
yield (href, text)
|
||||||
|
|
||||||
def write_row(self, row: AccrualPostings) -> None:
|
def write_row(self, row: AccrualPostings) -> None:
|
||||||
|
|
Loading…
Reference in a new issue