I have a form that can access by the boss account, the boss will use this form to create his employee accounts
def EmployeeForm(forms.Form):
username = forms.CharField(max_length = 16)
def clean_username(self):
if User.objects.filter(username = self.cleaned_data.get('username')).exists():
raise forms.ValidationError('A user with that user name already exists')
return self.cleaned_data.get('username')
But the problem is I don't now how to validate this username field like UserCreationForm Does, and I am pretty sure making username unique isn't enough