X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/47f52a37e100ff30ce8fe2c62835ae0b596b909b..6dc65dcaa0245bfb27f1a857016b8c25f8214557:/src/redirects/admin.py?ds=inline diff --git a/src/redirects/admin.py b/src/redirects/admin.py index 674240477..0889b580e 100644 --- a/src/redirects/admin.py +++ b/src/redirects/admin.py @@ -9,6 +9,8 @@ class RedirectAdmin(admin.ModelAdmin): fields = ['slug', 'url', 'counter', 'created_at', 'full_url'] def full_url(self, obj): + if not obj.slug: + return None site = Site.objects.get_current() url = obj.get_absolute_url() return f'https://{site.domain}{url}'