Skip to content
Snippets Groups Projects
Verified Commit d0d01f2d authored by Pinguin's avatar Pinguin :penguin:
Browse files

Do tox lint and reformat

parent 85c24673
No related branches found
No related tags found
1 merge request!1223Resolve "Links in object column of data check table is broken"
Pipeline #125163 failed
import random import random
import string import string
from urllib.parse import urlparse from urllib.parse import urlparse
from django import template from django import template
...@@ -32,7 +31,7 @@ def add_class_to_el(value: str, arg: str) -> str: ...@@ -32,7 +31,7 @@ def add_class_to_el(value: str, arg: str) -> str:
@register.filter @register.filter
def remove_prefix(value: str, prefix: str) -> str: def remove_prefix(value: str, prefix: str) -> str:
"""Remove prefix of a url """Remove prefix of a url.
:Example: :Example:
...@@ -43,7 +42,7 @@ def remove_prefix(value: str, prefix: str) -> str: ...@@ -43,7 +42,7 @@ def remove_prefix(value: str, prefix: str) -> str:
url = urlparse(value) url = urlparse(value)
if url.path.startswith(prefix): if url.path.startswith(prefix):
url = url._replace(path=url.path[len(prefix):]) url = url._replace(path=url.path[len(prefix) :])
return url.geturl() return url.geturl()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment