Ticket #2885: session_store_commit.patch

File session_store_commit.patch, 0.9 kB (added by pacopablo, 9 months ago)

Patch to fix missing commit() call in check_password and set_password. Fixes PostgreSQL compatability

  • db.py

    old new  
    5555                       "WHERE authenticated=1 AND name='password' " 
    5656                       "AND sid=%s", (hash, user)) 
    5757        if cursor.rowcount > 0: 
     58            db.commit() 
    5859            return False # updated existing password 
    5960        cursor.execute("INSERT INTO session_attribute " 
    6061                       "(sid,authenticated,name,value) " 
    6162                       "VALUES (%s,1,'password',%s)", 
    6263                       (user, hash)) 
     64        db.commit() 
    6365        return True 
    6466 
    6567    def check_password(self, user, password): 
     
    8789                       "AND sid=%s", (user,)) 
    8890        # TODO cursor.rowcount doesn't seem to get # deleted 
    8991        # is there another way to get count instead of using has_user? 
     92        db.commit() 
    9093        return True