Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
33c2507a
Commit
33c2507a
authored
Mar 13, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against connection errors to the Analytics service.
parent
e135a405
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
lms/djangoapps/instructor/views.py
+10
-3
lms/envs/dev.py
+0
-1
No files found.
lms/djangoapps/instructor/views.py
View file @
33c2507a
...
...
@@ -595,13 +595,20 @@ def instructor_dashboard(request, course_id):
#----------------------------------------
# analytics
def
get_analytics_result
(
analytics_name
):
"""Return data for an Analytic piece, or None if it doesn't exist. It
logs and swallows errors.
"""
url
=
settings
.
ANALYTICS_SERVER_URL
+
\
"get?aname={}&course_id={}"
.
format
(
analytics_name
,
course_id
)
res
=
requests
.
get
(
url
)
try
:
res
=
requests
.
get
(
url
)
except
Exception
:
log
.
exception
(
"Error trying to access analytics at
%
s"
,
url
)
return
None
if
res
.
status_code
==
codes
.
OK
:
# WARNING: do not use req.json because the preloaded json doesn't
# preserve the order of the original record use instead:
# json.loads(req.content, object_pairs_hook=OrderedDict)
# preserve the order of the original record (hence OrderedDict).
return
json
.
loads
(
res
.
content
,
object_pairs_hook
=
OrderedDict
)
else
:
log
.
error
(
"Error fetching
%
s, code:
%
s, msg:
%
s"
,
...
...
lms/envs/dev.py
View file @
33c2507a
...
...
@@ -221,4 +221,3 @@ PEARSON_TEST_PASSWORD = "12345"
########################## ANALYTICS TESTING ########################
ANALYTICS_SERVER_URL
=
"http://127.0.0.1:9000/"
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