Skip to content

Commit

Permalink
BUG FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
mailgyc-163 committed Feb 27, 2019
1 parent 70891e6 commit dce2c2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doudizhu/apps/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SignupHandler(BaseHandler):
async def post(self):
email = self.get_query_params('email', self.get_query_params('username'))
account = await self.db.fetchone('SELECT id FROM account WHERE email=%s', email)
if account and account.result():
if account:
self.write({'errcode': 1, 'errmsg': 'The email has already exist'})
return

Expand Down
3 changes: 1 addition & 2 deletions doudizhu/contrib/db/aio_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ async def fetchone(self, query: str, *args, **kwargs) -> Dict[str, str]:
cursor = await self.cursor()
try:
await self._execute(cursor, query, args, kwargs)
future: asyncio.Future = await cursor.fetchone()
return await future
return await cursor.fetchone()
finally:
await cursor.release()

Expand Down

0 comments on commit dce2c2c

Please sign in to comment.