From 4fda307664adadd0438c2ef83e72dbe6acea9ba4 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Fri, 20 Jan 2017 22:06:10 +0100 Subject: [PATCH] seminar | admin | kdyz cislo nema prirazene cislo reseni Kdyz cislo nema prirazene cislo reseni, tak nelze zjistovat fazy --- seminar/admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seminar/admin.py b/seminar/admin.py index e9a8801c..7c67f69e 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -418,8 +418,9 @@ class ProblemAdmin(VersionAdmin): return readonly_fields if obj.cislo_zadani.faze != 'admin': readonly_fields += ['nazev', 'text_zadani', 'body'] - if obj.cislo_reseni.faze != 'admin': - readonly_fields += ['text_reseni'] + if obj.cislo_reseni: + if obj.cislo_reseni.faze != 'admin': + readonly_fields += ['text_reseni'] return readonly_fields def get_queryset(self, request):