seminar | admin | kdyz cislo nema prirazene cislo reseni

Kdyz cislo nema prirazene cislo reseni,
tak nelze zjistovat fazy
This commit is contained in:
Bc. Petr Pecha 2017-01-20 22:06:10 +01:00
parent 5adc4eecb9
commit 4fda307664

View file

@ -418,8 +418,9 @@ class ProblemAdmin(VersionAdmin):
return readonly_fields return readonly_fields
if obj.cislo_zadani.faze != 'admin': if obj.cislo_zadani.faze != 'admin':
readonly_fields += ['nazev', 'text_zadani', 'body'] readonly_fields += ['nazev', 'text_zadani', 'body']
if obj.cislo_reseni.faze != 'admin': if obj.cislo_reseni:
readonly_fields += ['text_reseni'] if obj.cislo_reseni.faze != 'admin':
readonly_fields += ['text_reseni']
return readonly_fields return readonly_fields
def get_queryset(self, request): def get_queryset(self, request):