In my django Account app I have a model for Account class Account(AbstractBaseUser): wallet_value = models.DecimalField(max_digits=10, decimal_places=2, default=0.00) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) username = models.CharField(max_length=100) email = models.EmailField(max_length=200, unique=True) phone_number = models.CharField(max_length=20) """SOME OTHER REQUIED FIELD""" date_joined = models.DateTimeField(auto_now_add=True) last_login = models.DateTimeField(auto_now_add=True) is_admin = models.BooleanField(default=False) is_staff = models.BooleanField(default=False) is_superadmin = models.BooleanField(default=False) is_active = models.BooleanField(default=False) USERNAME_FIELD = "email" REQUIRED_FIELDS = ["first_name", "last_name", "username"] I also have a Registration form which is responsible for signup feature class RegistrationForm(forms.ModelForm): password = forms.CharField( widget=forms.PasswordInput( attrs={ "class": "form-control", } ) ) confirm_password = forms.CharField( widget=forms.PasswordInput(attrs={"class": "form-control"}) ) first_name = forms.CharField( widget=forms.TextInput( attrs={ "placeholder": "Enter First Name", "class": "form-control", } ) ) last_name = forms.CharField( widget=forms.TextInput( attrs={"placeholder": "Enter Last Name", "class": "form-control"} ) ) email = forms.CharField( widget=forms.EmailInput( attrs={ "placeholder": "Enter Email Adress", "class": "form-control", } ) ) phone_number = forms.CharField( widget=forms.NumberInput( attrs={"placeholder": "Enter Phone Number", "class": "form-control"} ) ) class Meta: model = Account fields = [ "first_name", "last_name", "email", "phone_number", "password", "confirm_password", ] def __init__(self, *args, **kwargs): super(RegistrationForm, self).__init__(*args, **kwargs) def clean(self): cleaned_data = super(RegistrationForm, self).clean() password = cleaned_data.get("password") confirm_password = cleaned_data.get("confirm_password") if password != confirm_password: raise forms.ValidationError( "password dose not match", ) and in my views.py which will handle registerationو I am using the validation of form so that if it is valid I will get the fields and create the user if form.is_valid(): # get the fields # create the user in database now I have a senario in which the user enter his information in registration form and an activation link will be sent to his email, so once he or her clicks on the activation link, his or her account will be activated. so everytime an email is entered in registration form I have to check if that email is in database or not. if it is not in database, create that user and send the activation link to that email, but if it is in database, we have to know if the email is activated or not. if yes, we will raise an error that this email is existed in database so signin, but if not, we have to check if the previous activation link is expired or not... if yes, send another acitvation link and inform the user about that and if not, just inform the user that an activation link had been sent to his email and he has to activate it.the algorithm is somthing like this # user click on registration button after fill the fields if emailIsInDatabase: if isAcitve: raise forms.ValidationError("there is an account with this email. please signin") else: if activationLinkIsExpired: # send another activation link # inform the user about that else: # inform the user to activate his or her link else: # send the activation link to the email Now the challenge is here.Imagine a senario that a user register on the website with a wrong email(that is for another person), so after clicking the submit, he or her understands that the email is wrong and register with the correct email. now if the other user that the first email was for him wants to create an account) when he or her, clicks on sumbit using that email, because this email is in database and it is not just actived yet, the form validation on unique email value will be called and it will raise an error that there is already an account with this email, so It won't go inside the form.is_valid() condition, so we can not recognize that we have to check for the activation link. I have already tried to find the specefic email validation in form and just ended to this part in clean function in the form : cleaned_data = super(RegistrationForm, self).clean() and once I removed this part and just use the clean data from self like this cleaned_data = self.cleaned_data It did not validate uniqueness of the email, but I think this is not a good way because by doing that I am just removing all of other validation that the form did over other parameters, so I am looking for a way to just removing the validation over email uniqueness I have also used clean_eamil function to specificly validate email on my own but It did not answer because after that, the clean function will be called and my own validation is useless. so what is the solution here? Thanks Continue reading...