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
2189ef7c
Commit
2189ef7c
authored
Jan 28, 2015
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the library tests.
TNL-836
parent
4d729100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
common/djangoapps/xblock_django/user_service.py
+4
-3
No files found.
common/djangoapps/xblock_django/user_service.py
View file @
2189ef7c
...
...
@@ -2,10 +2,8 @@
Support for converting a django user to an XBlock user
"""
from
django.contrib.auth.models
import
User
from
xblock.reference.user_service
import
XBlockUser
,
UserService
from
student.models
import
anonymous_id_for_user
,
get_user_by_username_or_email
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
xblock.reference.user_service
import
XBlockUser
,
UserService
ATTR_KEY_IS_AUTHENTICATED
=
'edx-platform.is_authenticated'
ATTR_KEY_USER_ID
=
'edx-platform.user_id'
...
...
@@ -42,6 +40,9 @@ class DjangoXBlockUserService(UserService):
if
not
self
.
_user_is_staff
:
return
None
# If we import these in start, it causes the contentstore library tests failed.
from
student.models
import
anonymous_id_for_user
,
get_user_by_username_or_email
try
:
user
=
get_user_by_username_or_email
(
username_or_email
=
username
)
except
User
.
DoesNotExist
:
...
...
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