mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
Piwik: Avoid logging failed requests twice
This commit is contained in:
parent
ce41b5320a
commit
851e098046
@ -25,6 +25,10 @@ def get_json_from_remote_server(func, **kwargs):
|
||||
from Piwik data.
|
||||
"""
|
||||
rawjson = func(**kwargs)
|
||||
if rawjson is None:
|
||||
# If the request failed we already logged in in PiwikRequest;
|
||||
# no need to get into the exception handler below.
|
||||
return {}
|
||||
try:
|
||||
data = json.loads(rawjson)
|
||||
if isinstance(data, dict) and data.get('result') == 'error':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user