admin: fix get_readonly_fields
This commit is contained in:
		
							parent
							
								
									9954f8359d
								
							
						
					
					
						commit
						47005053f9
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -417,9 +417,9 @@ class ProblemAdmin(VersionAdmin): | |||
|         readonly_fields = ['timestamp', 'import_dakos_id'] | ||||
|         if not obj: | ||||
|             return readonly_fields | ||||
|         if obj.cislo_zadani.faze != 'admin': | ||||
|         if obj.cislo_zadani and obj.cislo_zadani.faze != 'admin': | ||||
|             readonly_fields += ['nazev', 'text_zadani', 'body'] | ||||
|         if obj.cislo_reseni.faze != 'admin': | ||||
|         if obj.cislo_reseni and obj.cislo_reseni.faze != 'admin': | ||||
|             readonly_fields += ['text_reseni'] | ||||
|         return readonly_fields | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián