fixed variable name error and changed deprecated iteration on cursor.
fixed variable name error and changed deprecated iteration on cursor.

A variable was named cur instead of conn.
Iterating on a cursor is deprecated, used cur.fetchall instead.
aio-libs/aiopg,eirnym/aiopg