mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-10 04:02: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
|
# coding: utf-8
|
||||||
|
|
||||||
from time import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
from flask import request
|
from flask import request
|
||||||
from web import app
|
from web import app
|
||||||
@ -134,7 +134,7 @@ def scrobble():
|
|||||||
except:
|
except:
|
||||||
return request.error_formatter(0, 'Invalid time value')
|
return request.error_formatter(0, 'Invalid time value')
|
||||||
else:
|
else:
|
||||||
t = int(time())
|
t = int(time.time())
|
||||||
|
|
||||||
lfm = LastFm(request.user, app.logger)
|
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'])
|
reader = csv.reader(request.files['file'])
|
||||||
for id, name, mail, password, salt, admin, lfmsess, lfmstatus in reader:
|
for id, name, mail, password, salt, admin, lfmsess, lfmstatus in reader:
|
||||||
mail = None if mail == 'None' else mail
|
mail = None if mail == 'None' else mail
|
||||||
admin = bool(admin)
|
admin = admin == 'True'
|
||||||
lfmsess = None if lfmsess == 'None' else lfmsess
|
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))
|
users.append(User(id = uuid.UUID(id), name = name, password = password, salt = salt, admin = admin, lastfm_session = lfmsess, lastfm_status = lfmstatus))
|
||||||
|
|
||||||
User.query.delete()
|
User.query.delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user