ruff rule A

This commit is contained in:
thomas girod
2024-06-27 14:30:58 +02:00
parent 3014d8cead
commit 688871a680
9 changed files with 35 additions and 34 deletions

View File

@ -22,8 +22,8 @@ from mistune import InlineGrammar, InlineLexer, Markdown, Renderer, escape, esca
class SithRenderer(Renderer):
def file_link(self, id, suffix):
return reverse("core:file_detail", kwargs={"file_id": id}) + suffix
def file_link(self, pk, suffix):
return reverse("core:file_detail", kwargs={"file_id": pk}) + suffix
def exposant(self, text):
return """<sup>%s</sup>""" % text
@ -158,7 +158,7 @@ class SithInlineLexer(InlineLexer):
try: # Add file:// support for links
file_link = re.compile(r"^file://(\d*)/?(\S*)?") # file://4000/download
match = file_link.search(link)
id = match.group(1)
pk = match.group(1)
suffix = match.group(2) or ""
link = reverse("core:file_detail", kwargs={"file_id": id}) + suffix
except: