TeX API: povoleno jen v určitých fázích čísla
This commit is contained in:
		
							parent
							
								
									02a7076397
								
							
						
					
					
						commit
						e0882def44
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -752,6 +752,12 @@ def texDownloadView(request, rocnik, cislo): | |||
|     """View posílající JSON se zadanými a řešenými problémy pro založení čísla | ||||
|     """ | ||||
|     cislo = Cislo.objects.get(rocnik__rocnik=rocnik, cislo=cislo) | ||||
|     if cislo.faze == cislo.FAZE_NAHRANO: | ||||
|         # obsah byl nahrán z TeXu na web, už je příliš složitý | ||||
|         return JsonResponse( | ||||
|             {"error": "Obsah čísla už byl nahrán z TeXu na web."} | ||||
|         ) | ||||
| 
 | ||||
|     zadane = Problem.objects.filter( | ||||
|         cislo_zadani=cislo, | ||||
|         stav=Problem.STAV_ZADANY | ||||
|  | @ -788,4 +794,7 @@ def texDownloadView(request, rocnik, cislo): | |||
|             } for p in resene | ||||
|         ], | ||||
|     } | ||||
| 
 | ||||
|     cislo.faze = Cislo.FAZE_TEX | ||||
|     cislo.save() | ||||
|     return JsonResponse(response) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián