Browse Source

Admin: fix odkazu na číslo zadání/řešení

remotes/origin/test
Matěj Kocián 8 years ago
parent
commit
75794b5e48
  1. 4
      seminar/admin.py

4
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('<a href="{}">{}</a>'.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('<a href="{}">{}</a>'.format(
reverse("admin:seminar_cislo_change", args=(obj.cislo_reseni.pk,)),
obj.cislo_reseni

Loading…
Cancel
Save