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): |     def clean(self): | ||||||
|         email = self.cleaned_data.get('email') |         email = self.cleaned_data.get('email') | ||||||
|         password = self.cleaned_data.get('password') |         password = self.cleaned_data.get('password') | ||||||
|  |         if self.errors: | ||||||
|  |             return self.cleaned_data | ||||||
|         is_auth = authenticate(email=email, password=password) |         is_auth = authenticate(email=email, password=password) | ||||||
|         if not is_auth: |         if not is_auth: | ||||||
|             raise forms.ValidationError( |             raise forms.ValidationError( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue