diff --git a/seminar/admin.py b/seminar/admin.py
index cdb9f3fc..1532b54d 100644
--- a/seminar/admin.py
+++ b/seminar/admin.py
@@ -495,6 +495,8 @@ class ProblemZadanyAdmin(ProblemAdmin):
]
def cislo_zadani_link(self, obj):
+ if not obj.cislo_zadani:
+ return ""
return mark_safe('{}'.format(
reverse("admin:seminar_cislo_change", args=(obj.cislo_zadani.pk,)),
obj.cislo_zadani
@@ -505,6 +507,8 @@ class ProblemZadanyAdmin(ProblemAdmin):
# nějak zjednodušit, např. tímto?
# https://github.com/gitaarik/django-admin-relation-links
def cislo_reseni_link(self, obj):
+ if not obj.cislo_reseni:
+ return ""
return mark_safe('{}'.format(
reverse("admin:seminar_cislo_change", args=(obj.cislo_reseni.pk,)),
obj.cislo_reseni