title: How to debug a Internal Error current transaction is aborted, commands ignored until end of transaction block?
body: <p>I am coming across this error <code>current transaction is aborted, commands ignored until end of transaction block</code>,
  the traceback is too long so, am printing out the line that seems to cause the error,</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>and here is part(its pretty long) of where the error is being generated</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Now what confuses me most is that this worked fine with sqlite but when i switched to postgresql, this error come by.</p>
  
  <p>I have looked here (<a href="https://stackoverflow.com/questions/2979369/databaseerror-current-transaction-is-aborted-commands-ignored-until-end-of-tra?rq=1">DatabaseError: current transaction is aborted, commands ignored until end of transaction block</a>) and here (<a href="https://stackoverflow.com/questions/7753016/djangopostgres-current-transaction-is-aborted-commands-ignored-until-end-of?lq=1">Django+Postgres: &quot;current transaction is aborted, commands ignored until end of transaction block&quot;</a>) but to no vain.
   How do you suggest i squash this bug?</p>
  
  <p><strong>EDIT:</strong> After looking around, i realised the error was caused by a library that am using and has never been tested with postgres.</p>