Comment/clean unused code
This commit is contained in:
		
					parent
					
						
							
								e8f12e18d2
							
						
					
				
			
			
				commit
				
					
						76c585cdf4
					
				
			
		
					 1 changed files with 4 additions and 15 deletions
				
			
		
							
								
								
									
										19
									
								
								dal/forms.py
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								dal/forms.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,5 @@
 | 
			
		|||
from django import forms
 | 
			
		||||
from django.contrib.auth import authenticate
 | 
			
		||||
from django.shortcuts import render
 | 
			
		||||
from django.utils.translation import ugettext_lazy as _
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -21,22 +20,12 @@ class LoginForm(forms.Form):
 | 
			
		|||
            raise forms.ValidationError(
 | 
			
		||||
                _("Your username and/or password were incorrect.")
 | 
			
		||||
            )
 | 
			
		||||
        elif is_auth.validated == 0:
 | 
			
		||||
            raise forms.ValidationError(
 | 
			
		||||
                _("Your account is not activated yet.")
 | 
			
		||||
            )
 | 
			
		||||
        # elif is_auth.validated == 0:
 | 
			
		||||
        #     raise forms.ValidationError(
 | 
			
		||||
        #         _("Your account is not activated yet.")
 | 
			
		||||
        #     )
 | 
			
		||||
        return self.cleaned_data
 | 
			
		||||
 | 
			
		||||
    def clean_email(self):
 | 
			
		||||
        email = self.cleaned_data.get('email')
 | 
			
		||||
        return email
 | 
			
		||||
        # try:
 | 
			
		||||
        #     CustomUser.objects.get(email=email)
 | 
			
		||||
        #     return email
 | 
			
		||||
        # except CustomUser.DoesNotExist:
 | 
			
		||||
        #     raise forms.ValidationError(_("User does not exist"))
 | 
			
		||||
 | 
			
		||||
    def form_valid(self, form):
 | 
			
		||||
        form.save()
 | 
			
		||||
        return render(self.request, 'useroptions.html', {'user': self.get_context_data()})
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue