[Fixed]-User matching query does not exist

1👍

Try this:

u = user.objects.filter(username=uname).first()
if not u:
    return uname
raise forms.ValidationError('Username not available')
👤nima

0👍

Instead of

u = user.objects.get(username = uname)

It should be :

u = User.objects.get(username = uname)

Leave a comment