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
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5eaa5320
Commit
5eaa5320
authored
4 years ago
by
stvn
Browse files
Options
Downloads
Patches
Plain Diff
Fix segment_context key error
This is one of the frequent TNL errors.
parent
1189580e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/track/views/segmentio.py
+2
-2
2 additions, 2 deletions
common/djangoapps/track/views/segmentio.py
with
2 additions
and
2 deletions
common/djangoapps/track/views/segmentio.py
+
2
−
2
View file @
5eaa5320
...
...
@@ -127,7 +127,7 @@ def track_segmentio_event(request): # pylint: disable=too-many-statements
# Start with the context provided by Segment in the "client" field if it exists
# We should tightly control which fields actually get included in the event emitted.
segment_context
=
full_segment_event
.
get
(
'
context
'
)
segment_context
=
full_segment_event
.
get
(
'
context
'
,
{}
)
# Build up the event context by parsing fields out of the event received from Segment
context
=
{}
...
...
@@ -163,7 +163,7 @@ def track_segmentio_event(request): # pylint: disable=too-many-statements
if
'
application
'
not
in
app_context
:
context
[
'
application
'
]
=
{
'
name
'
:
app_context
.
get
(
'
app_name
'
,
''
),
'
version
'
:
''
if
not
segment_context
else
segment_context
.
get
(
'
app
'
,
{}).
get
(
'
version
'
,
''
)
'
version
'
:
segment_context
.
get
(
'
app
'
,
{}).
get
(
'
version
'
,
''
)
,
}
app_context
.
pop
(
'
app_name
'
,
None
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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