Merge branch 'develop'

pull/42/MERGE
13621160019@163.com 2021-05-18 14:38:32 +08:00
commit e269861a8e
1 changed files with 3 additions and 1 deletions

View File

@ -1299,7 +1299,9 @@ class SpaceMeterItem:
cursor.execute(" SELECT id "
" FROM tbl_spaces_meters "
" WHERE space_id = %s AND meter_id = %s ", (id_, mid))
if cursor.fetchone() is None:
# use fetchall to avoid 'Unread result found' error in case there are duplicate rows
rows = cursor.fetchall()
if rows is None or len(rows) == 0:
cursor.close()
cnx.disconnect()
raise falcon.HTTPError(falcon.HTTP_404, title='API.NOT_FOUND',