diff --git a/api/annotation.py b/api/annotation.py index 99fe356..b9edefd 100755 --- a/api/annotation.py +++ b/api/annotation.py @@ -1,6 +1,6 @@ # coding: utf-8 -from time import time +import time import uuid from flask import request from web import app @@ -134,7 +134,7 @@ def scrobble(): except: return request.error_formatter(0, 'Invalid time value') else: - t = int(time()) + t = int(time.time()) lfm = LastFm(request.user, app.logger) diff --git a/user.py b/user.py index 39a49ff..83f72e1 100755 --- a/user.py +++ b/user.py @@ -129,9 +129,9 @@ def do_user_import(): reader = csv.reader(request.files['file']) for id, name, mail, password, salt, admin, lfmsess, lfmstatus in reader: mail = None if mail == 'None' else mail - admin = bool(admin) + admin = admin == 'True' lfmsess = None if lfmsess == 'None' else lfmsess - lfmstatus = bool(lfmstatus) + lfmstatus = lfmstatus == 'True' users.append(User(id = uuid.UUID(id), name = name, password = password, salt = salt, admin = admin, lastfm_session = lfmsess, lastfm_status = lfmstatus)) User.query.delete()