Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acoustid-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AcoustID
acoustid-server
Commits
dc4f9131
Commit
dc4f9131
authored
Oct 26, 2019
by
Lukáš Lalinský
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix internal API
parent
32d9903e
Pipeline
#20580
passed with stages
in 5 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
acoustid/api/v2/internal.py
acoustid/api/v2/internal.py
+9
-9
No files found.
acoustid/api/v2/internal.py
View file @
dc4f9131
...
@@ -25,8 +25,8 @@ logger = logging.getLogger(__name__)
...
@@ -25,8 +25,8 @@ logger = logging.getLogger(__name__)
class
UpdateLookupStatsHandlerParams
(
APIHandlerParams
):
class
UpdateLookupStatsHandlerParams
(
APIHandlerParams
):
def
parse
(
self
,
values
,
conn
):
def
parse
(
self
,
values
,
db
):
super
(
UpdateLookupStatsHandlerParams
,
self
)
.
parse
(
values
,
conn
)
super
(
UpdateLookupStatsHandlerParams
,
self
)
.
parse
(
values
,
db
)
self
.
secret
=
values
.
get
(
'secret'
)
self
.
secret
=
values
.
get
(
'secret'
)
self
.
application_id
=
values
.
get
(
'application_id'
,
type
=
int
)
self
.
application_id
=
values
.
get
(
'application_id'
,
type
=
int
)
self
.
date
=
values
.
get
(
'date'
)
self
.
date
=
values
.
get
(
'date'
)
...
@@ -83,13 +83,13 @@ class UpdateUserAgentStatsHandler(APIHandler):
...
@@ -83,13 +83,13 @@ class UpdateUserAgentStatsHandler(APIHandler):
class
LookupStatsHandlerParams
(
APIHandlerParams
):
class
LookupStatsHandlerParams
(
APIHandlerParams
):
def
parse
(
self
,
values
,
conn
):
def
parse
(
self
,
values
,
db
):
super
(
LookupStatsHandlerParams
,
self
)
.
parse
(
values
,
conn
)
super
(
LookupStatsHandlerParams
,
self
)
.
parse
(
values
,
db
)
self
.
secret
=
values
.
get
(
'secret'
)
self
.
secret
=
values
.
get
(
'secret'
)
apikeys
=
values
.
getlist
(
'client'
)
apikeys
=
values
.
getlist
(
'client'
)
if
not
apikeys
:
if
not
apikeys
:
raise
errors
.
InvalidAPIKeyError
()
raise
errors
.
InvalidAPIKeyError
()
self
.
applications
=
find_applications_by_apikeys
(
conn
,
apikeys
)
self
.
applications
=
find_applications_by_apikeys
(
db
.
get_app_db
()
,
apikeys
)
if
not
self
.
applications
:
if
not
self
.
applications
:
raise
errors
.
InvalidAPIKeyError
()
raise
errors
.
InvalidAPIKeyError
()
self
.
from_date
=
values
.
get
(
'from'
)
self
.
from_date
=
values
.
get
(
'from'
)
...
@@ -117,7 +117,7 @@ class LookupStatsHandler(APIHandler):
...
@@ -117,7 +117,7 @@ class LookupStatsHandler(APIHandler):
kwargs
[
'to_date'
]
=
params
.
to_date
kwargs
[
'to_date'
]
=
params
.
to_date
if
params
.
days
is
not
None
:
if
params
.
days
is
not
None
:
kwargs
[
'days'
]
=
params
.
days
kwargs
[
'days'
]
=
params
.
days
stats
=
find_application_lookup_stats_multi
(
self
.
c
onn
,
application_ids
.
keys
(),
**
kwargs
)
stats
=
find_application_lookup_stats_multi
(
self
.
c
tx
.
db
.
get_app_db
()
,
application_ids
.
keys
(),
**
kwargs
)
for
entry
in
stats
:
for
entry
in
stats
:
entry
[
'date'
]
=
entry
[
'date'
]
.
strftime
(
'
%
Y-
%
m-
%
d'
)
entry
[
'date'
]
=
entry
[
'date'
]
.
strftime
(
'
%
Y-
%
m-
%
d'
)
return
{
'stats'
:
stats
}
return
{
'stats'
:
stats
}
...
@@ -125,8 +125,8 @@ class LookupStatsHandler(APIHandler):
...
@@ -125,8 +125,8 @@ class LookupStatsHandler(APIHandler):
class
CreateAccountHandlerParams
(
APIHandlerParams
):
class
CreateAccountHandlerParams
(
APIHandlerParams
):
def
parse
(
self
,
values
,
conn
):
def
parse
(
self
,
values
,
db
):
super
(
CreateAccountHandlerParams
,
self
)
.
parse
(
values
,
conn
)
super
(
CreateAccountHandlerParams
,
self
)
.
parse
(
values
,
db
)
self
.
secret
=
values
.
get
(
'secret'
)
self
.
secret
=
values
.
get
(
'secret'
)
...
@@ -138,7 +138,7 @@ class CreateAccountHandler(APIHandler):
...
@@ -138,7 +138,7 @@ class CreateAccountHandler(APIHandler):
if
self
.
cluster
.
secret
!=
params
.
secret
:
if
self
.
cluster
.
secret
!=
params
.
secret
:
logger
.
warning
(
'Invalid cluster secret'
)
logger
.
warning
(
'Invalid cluster secret'
)
raise
errors
.
NotAllowedError
()
raise
errors
.
NotAllowedError
()
account_id
,
account_api_key
=
insert_account
(
self
.
c
onn
,
{
account_id
,
account_api_key
=
insert_account
(
self
.
c
tx
.
db
.
get_app_db
()
,
{
'name'
:
'External User'
,
'name'
:
'External User'
,
'anonymous'
:
True
,
'anonymous'
:
True
,
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment