try:
user = User.objects.create_user(_username, _email, pwd)
except IntegrityError, e:
fail = e.message
return render_to_response('register.html',{'reg_fail':fail},context_instance=RequestContext(request))
I have this code, once i catch the IntegrityError, i am getting this error: current transaction is aborted, commands ignored until end of transaction block
why is this? if i delete the context_instance
part, then i am getting again the page but without any media access. I am stuck, i want just to register a user or if integrityError, then render to register page with error message.
by the way: i am using django1.4 and postgresql. and User
is django's auth user
With
user_create
you start transaction, and doing this again cause the error of not commited transaction.You have to commit(end) your transaction afteruser_create
as follow: