Updated from template

This commit is contained in:
Ivan Sokolov 2023-11-06 19:23:04 +01:00 committed by Justine Doutreloux
parent e7c562205e
commit 8ef3f40ee4
3 changed files with 5 additions and 5 deletions

View File

@ -106,7 +106,7 @@ class DocumentPage(models.Model):
action = parent.menu_id.action action = parent.menu_id.action
parent = parent.parent_id parent = parent.parent_id
if action: if action:
url += "&action={}".format(action.id) url += f"&action={action.id}"
rec.backend_url = url rec.backend_url = url
@api.constrains("parent_id") @api.constrains("parent_id")
@ -122,7 +122,7 @@ class DocumentPage(models.Model):
] ]
r = "" r = ""
if link: if link:
r = '<a href="{}">{}</a>'.format(self.backend_url, self.name) r = f'<a href="{self.backend_url}">{self.name}</a>'
if index: if index:
r += "<ul>" + "".join(index) + "</ul>" r += "<ul>" + "".join(index) + "</ul>"
return r return r

View File

@ -61,8 +61,8 @@ class DocumentPageHistory(models.Model):
return diff.make_table( return diff.make_table(
line1, line1,
line2, line2,
"Revision-{}".format(v1), f"Revision-{v1}",
"Revision-{}".format(v2), f"Revision-{v2}",
context=True, context=True,
) )

View File

@ -39,7 +39,7 @@ class TestDocumentPage(common.TransactionCase):
page = self.page_obj.create({"name": "Test Page 3", "content": "Test content"}) page = self.page_obj.create({"name": "Test Page 3", "content": "Test content"})
self.assertEqual( self.assertEqual(
page.backend_url, page.backend_url,
"/web#id={}&model=document.page&view_type=form".format(page.id), f"/web#id={page.id}&model=document.page&view_type=form",
) )
menu = self.env.ref("document_knowledge.menu_document") menu = self.env.ref("document_knowledge.menu_document")
page.menu_id = menu page.menu_id = menu