Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion qiita_db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,15 @@ def verify_code(cls, email, code, code_type):
sql = ("SELECT {1} from qiita.{0} where email"
" = %s".format(cls._table, column))
conn_handler = SQLConnectionHandler()
db_code = conn_handler.execute_fetchone(sql, (email,))[0]
db_code = conn_handler.execute_fetchone(sql, (email,))

# If the query didn't return anything, then there's no way the code
# can match
if db_code is None:
return False

db_code = db_code[0]

if db_code == code and code_type == "create":
# verify the user
level = conn_handler.execute_fetchone(
Expand Down