Re: Integrity Error: column username is not unique

2014-02-26 Thread Ravikumar Patil
> from django.shortcuts import get_object_or_404 > > get_object_or_404(User,username = request.user) > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djang

Re: Integrity Error: column username is not unique

2013-03-28 Thread Jaimin Patel
If the user is marked as deleted and we want to do soft delete.What can we do to have the username available again for use. Can we just mask the deleted usernames with some random string so that the actual username can be used? On Sunday, June 24, 2012 10:36:02 AM UTC-4, Dhivya wrote: > > Hi, >

Re: Integrity Error: column username is not unique

2012-06-24 Thread Dhivya
Hi, username field in django.contrib.auth.User model is unique. Probably, the username you are trying to save already exists. In your view, you might want to check, try: username = User.objects.get(username=form.cleaned_data['username']) except ObjectDoesNotExist: #create user new obje