def modify_user(self, username, data):
if '<STR_LIT:password>' in data:<EOL><INDENT>char_set = string.ascii_letters + string.digits<EOL>data['<STR_LIT>'] = '<STR_LIT>'.join(random.choice(char_set) for x in range(<NUM_LIT:8>))<EOL>data['<STR_LIT>'] = self._gen_hash(data['<STR_LIT:password>'], data['<STR_LIT>'])<EOL>del(data['<STR_LIT:password>'])<EOL><DEDENT>sql = "<STR_LIT>"<EOL>sql += '<STR_LIT:U+002CU+0020>'.join("<STR_LIT>" % k for k in sorted(data))<EOL>sql += "<STR_LIT>"<EOL>vals = []<EOL>for k in sorted(data):<EOL><INDENT>vals.append(data[k])<EOL><DEDENT>vals.append(username)<EOL>try:<EOL><INDENT>self._db_curs.execute(sql, vals)<EOL>self._db_conn.commit()<EOL><DEDENT>except (sqlite3.OperationalError, sqlite3.IntegrityError) as error:<EOL><INDENT>raise AuthError(error)<EOL><DEDENT>
Modify user in SQLite database.

            Since username is used as primary key and we only have a single
            argument for it we can't modify the username right now.