Fix: hromadné přidávátko (neumím používat clean…)
This commit is contained in:
		
							parent
							
								
									07b163389d
								
							
						
					
					
						commit
						ebe3bd8eda
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -36,6 +36,7 @@ class HromadnePridaniForm(Form): | |||
| 				nazev__exact=self.cleaned_data['tema'], | ||||
| 				nadproblem=None).count() != 1: | ||||
| 			raise ValidationError("Špatný nebo nepřesně zadaný název témátka") | ||||
| 		return self.cleaned_data['tema'] | ||||
| 
 | ||||
| 	def clean_body(self): | ||||
| 		""" Kontrola, že `body` je seznam čísel """ | ||||
|  | @ -43,6 +44,7 @@ class HromadnePridaniForm(Form): | |||
| 			list(map(int, self.cleaned_data["body"].split(","))) | ||||
| 		except ValueError: | ||||
| 			raise ValidationError("Špatný formát bodů") | ||||
| 		return self.cleaned_data['body'] | ||||
| 
 | ||||
| 
 | ||||
| class HromadnePridaniView(FormView): | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue