diff options
author | 2019-04-18 17:35:58 +0100 | |
---|---|---|
committer | 2019-04-18 17:35:58 +0100 | |
commit | 9dd3a0b3d87a0fe3162a403b891aab1e26dfffe1 (patch) | |
tree | 2b69fb2e34fe438bc8b391c8820624a0dae707e7 /pydis_site/apps | |
parent | Prevent accidental submission of link plugin form (diff) |
Delete/Error/Move/Permission Denied pages
Diffstat (limited to 'pydis_site/apps')
-rw-r--r-- | pydis_site/apps/home/templatetags/wiki_extra.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py index e0a27973..63d9bade 100644 --- a/pydis_site/apps/home/templatetags/wiki_extra.py +++ b/pydis_site/apps/home/templatetags/wiki_extra.py @@ -1,3 +1,5 @@ +from typing import Union + from django import template from django.forms import ( BooleanField, BoundField, CharField, ChoiceField, ComboField, DateField, DateTimeField, DecimalField, DurationField, @@ -97,5 +99,8 @@ def get_field_options(context, field: BoundField): @register.filter -def render_urlpath(value: URLPath): +def render_urlpath(value: Union[URLPath, str]): + if isinstance(value, str): + return value or "/" + return value.path or "/" |