Return if the form already contains error
This commit is contained in:
		
					parent
					
						
							
								e7882c0dec
							
						
					
				
			
			
				commit
				
					
						ed05411dac
					
				
			
		
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -29,6 +29,8 @@ class HostingUserLoginForm(forms.Form): | |||
|     def clean(self): | ||||
|         email = self.cleaned_data.get('email') | ||||
|         password = self.cleaned_data.get('password') | ||||
|         if self.errors: | ||||
|             return self.cleaned_data | ||||
|         is_auth = authenticate(email=email, password=password) | ||||
|         if not is_auth: | ||||
|             raise forms.ValidationError( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue