I am coming across this error current transaction is aborted, commands ignored until end of transaction block
,
the traceback is too long so, am printing out the line that seems to cause the error,
File "/home/matsinvasion/food4less/restaurant_detail/views.py" in pre_save
176. user=User.objects.create(username=obj.restaurant_detail.email,email=obj.restaurant_detail.email)
and here is part(its pretty long) of where the error is being generated
user=User.objects.create(username=obj.restaurant_detail.email,email=obj.restaurant_detail.email)
user.email_user(
"F4L account activation",
"Your membership to F4L has been approved go to the following link to activate your account \n \n http://f4l.herokuapp.com/restaurant_detail/restaurant/activate/%s/ \n \n After you have activated your account, login using your full email address as username and your password \n \n And customize what will be published on your F4L website profile by click profile link on the left of members \n \n This email is generated by the F4L website do not reply to it. " % obj.token,"website@f4l.herokuapp.com"
)
group=Group.objects.get(name='Restaurants')
user.groups.add(group)
user.first_name=userapp.first_name
user.last_name=userapp.last_name
user.email=userapp.email
user.set_unusable_password()
user.save()
obj.user=user
obj.is_active=False
obj.save()
return obj
Now what confuses me most is that this worked fine with sqlite but when i switched to postgresql, this error come by.
I have looked here (DatabaseError: current transaction is aborted, commands ignored until end of transaction block) and here (Django+Postgres: "current transaction is aborted, commands ignored until end of transaction block") but to no vain. How do you suggest i squash this bug?
EDIT: After looking around, i realised the error was caused by a library that am using and has never been tested with postgres.