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):