mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +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:
parent
bc4460e739
commit
9b3bb99b48
@ -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)
|
||||
|
||||
|
4
user.py
4
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()
|
||||
|
Loading…
Reference in New Issue
Block a user