From 22e115b5e9022e38982787ebfd58c384c5c5d6f0 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 30 Apr 2020 10:27:49 +0200 Subject: [PATCH 1/1] fix --- src/redirects/admin.py | 2 ++ 1 file changed, 2 insertions(+) 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}' -- 2.20.1