1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-09-19 19:01:03 +00:00

Some small fixes

The code in api/annotation.py was technically correct, but caused
exceptions in a wsgi environment
This commit is contained in:
spl0k 2013-06-17 17:06:11 +02:00
parent bc4460e739
commit 9b3bb99b48
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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()