title: psycopg2 no error but not inserted into DB
body: <p>I'm using the class below, and I can successfully retrieve data using the "getAccount" method, but the "insertToken" method does not insert the data. I've tried the SQL manually and it does work. I also don't get any errors. Any idea what is wrong here?</p>
  
  <pre><code>import psycopg2
  import psycopg2.extras
  
  class Database:
      variable = "blah"
  
      def getAccount(self):
          accountId = 0;
          username = ""
          password = ""
          try:
              conn = psycopg2.connect("dbname='token_generator' user='token_generator' host='myip' password='mypass'")
              cur = conn.cursor()
              try:
                  cur.execute("""SELECT id, username, password from account where used = false limit 1""")
              except Exception as e: print(e)
              rows = cur.fetchall()
              for row in rows:
                  accountId = row[0]
                  username = row[1]
                  password = row[2]
          except:
              print("I am unable to connect to the database")
          return (accountId, username, password)
  
  
      def insertToken(self, token, accountId):
          try:
              conn = psycopg2.connect("dbname='token_generator' user='token_generator' host='myip' password='mypass'")
              cur = conn.cursor()
              try:
                  cur.execute("INSERT INTO token (token, account_id) VALUES (%s, %s)", (token, accountId))
              except Exception as e: print(e)
          except:
              print("I am unable to connect to the database")
  </code></pre>