Skip to content
Open
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
8 changes: 4 additions & 4 deletions src/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class Track():

def __init__(self, db):
self._db = db
self._cur = db.getCursor()

try:
self._dir = cherrypy.config.get('track.dir', None)
except ConfigParser.NoOptionError as e:
Expand All @@ -74,12 +72,14 @@ def __del__(self):
# ----------------------------------------------------------------------------------------------

def getNewId(self, username):
self._cur.execute(
cursor = self._db.getCursor()
cursor.execute(
'''
SELECT nextval('user_tracks_track_id_seq')
'''
)
record = self._cur.fetchone()

record = cursor.fetchone()
self._db.commit()
if record == None:
raise Error(201, 'Unable to fetch new track id.', 'TRACK')
Expand Down