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
147bb014
Commit
147bb014
authored
Jun 14, 2016
by
Adam
Committed by
GitHub
Jun 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12746 from edx/adam/fix-error-message
make error message more readable
parents
b8fbab67
44636fe6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
common/djangoapps/student/models.py
+9
-7
No files found.
common/djangoapps/student/models.py
View file @
147bb014
...
...
@@ -127,7 +127,7 @@ def anonymous_id_for_user(user, course_id, save=True):
hasher
.
update
(
settings
.
SECRET_KEY
)
hasher
.
update
(
unicode
(
user
.
id
))
if
course_id
:
hasher
.
update
(
course_id
.
to_deprecated_string
(
)
.
encode
(
'utf-8'
))
hasher
.
update
(
unicode
(
course_id
)
.
encode
(
'utf-8'
))
digest
=
hasher
.
hexdigest
()
if
not
hasattr
(
user
,
'_anonymous_id'
):
...
...
@@ -146,12 +146,14 @@ def anonymous_id_for_user(user, course_id, save=True):
)
if
anonymous_user_id
.
anonymous_user_id
!=
digest
:
log
.
error
(
u"Stored anonymous user id
%
r for user
%
r "
u"in course
%
r doesn't match computed id
%
r"
,
user
,
course_id
,
anonymous_user_id
.
anonymous_user_id
,
digest
u"Stored anonymous user id
%(anonymous_user_id)
r for "
u"user
%(user)
r in course
%(course_id)
r doesn't match "
u"computed id
%(digest)
r"
,
{
"anonymous_user_id"
:
anonymous_user_id
.
anonymous_user_id
,
"user"
:
user
,
"course_id"
:
course_id
,
"digest"
:
digest
,
}
)
except
IntegrityError
:
# Another thread has already created this entry, so
...
...
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