Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Monday, March 24th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
e37e7e67
Commit
e37e7e67
authored
5 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Add metrics and logging around track selection rendering without enrollment
parent
b14244fe
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/course_modes/views.py
+12
-0
12 additions, 0 deletions
common/djangoapps/course_modes/views.py
with
12 additions
and
0 deletions
common/djangoapps/course_modes/views.py
+
12
−
0
View file @
e37e7e67
...
...
@@ -5,6 +5,7 @@ from __future__ import absolute_import, unicode_literals
import
decimal
import
json
import
logging
import
six
import
six.moves.urllib.error
...
...
@@ -21,6 +22,7 @@ from django.utils.decorators import method_decorator
from
django.utils.translation
import
get_language
,
to_locale
from
django.utils.translation
import
ugettext
as
_
from
django.views.generic.base
import
View
from
edx_django_utils.monitoring.utils
import
increment
from
ipware.ip
import
get_ip
from
opaque_keys.edx.keys
import
CourseKey
from
six
import
text_type
...
...
@@ -41,6 +43,9 @@ from util.db import outer_atomic
from
xmodule.modulestore.django
import
modulestore
LOG
=
logging
.
getLogger
(
__name__
)
class
ChooseModeView
(
View
):
"""
View used when the user is asked to pick a mode.
...
...
@@ -94,6 +99,13 @@ class ChooseModeView(View):
return
redirect
(
embargo_redirect
)
enrollment_mode
,
is_active
=
CourseEnrollment
.
enrollment_mode_for_user
(
request
.
user
,
course_key
)
increment
(
'
track-selection.{}.{}
'
.
format
(
enrollment_mode
,
'
active
'
if
is_active
else
'
inactive
'
))
increment
(
'
track-selection.views
'
)
if
enrollment_mode
is
None
:
LOG
.
info
(
'
Rendering track selection for unenrolled user, referred by %s
'
,
request
.
META
.
get
(
'
HTTP_REFERER
'
))
modes
=
CourseMode
.
modes_for_course_dict
(
course_key
)
ecommerce_service
=
EcommerceService
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment