From 9b3bb99b48810800cb50eed3bd93aeb0af10f1ae Mon Sep 17 00:00:00 2001 From: spl0k Date: Mon, 17 Jun 2013 17:06:11 +0200 Subject: [PATCH] Some small fixes The code in api/annotation.py was technically correct, but caused exceptions in a wsgi environment --- api/annotation.py | 4 ++-- user.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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()