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
a2168c2c
Commit
a2168c2c
authored
Nov 10, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/api-remove-isactive-user-filter: Removed registration check from older operations
parent
2f4defa6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lms/djangoapps/api_manager/courses/views.py
+1
-1
lms/djangoapps/api_manager/users/views.py
+3
-3
No files found.
lms/djangoapps/api_manager/courses/views.py
View file @
a2168c2c
...
@@ -1144,7 +1144,7 @@ class CoursesUsersDetail(SecureAPIView):
...
@@ -1144,7 +1144,7 @@ class CoursesUsersDetail(SecureAPIView):
DELETE /api/courses/{course_id}/users/{user_id}
DELETE /api/courses/{course_id}/users/{user_id}
"""
"""
try
:
try
:
user
=
User
.
objects
.
get
(
id
=
user_id
,
is_active
=
True
)
user
=
User
.
objects
.
get
(
id
=
user_id
)
except
ObjectDoesNotExist
:
except
ObjectDoesNotExist
:
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
if
not
course_exists
(
request
,
request
.
user
,
course_id
):
if
not
course_exists
(
request
,
request
.
user
,
course_id
):
...
...
lms/djangoapps/api_manager/users/views.py
View file @
a2168c2c
...
@@ -684,7 +684,7 @@ class UsersGroupsDetail(SecureAPIView):
...
@@ -684,7 +684,7 @@ class UsersGroupsDetail(SecureAPIView):
"""
"""
DELETE /api/users/{user_id}/groups/{group_id}
DELETE /api/users/{user_id}/groups/{group_id}
"""
"""
existing_user
=
User
.
objects
.
get
(
id
=
user_id
,
is_active
=
True
)
existing_user
=
User
.
objects
.
get
(
id
=
user_id
)
existing_user
.
groups
.
remove
(
group_id
)
existing_user
.
groups
.
remove
(
group_id
)
existing_user
.
save
()
existing_user
.
save
()
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
...
@@ -828,7 +828,7 @@ class UsersCoursesDetail(SecureAPIView):
...
@@ -828,7 +828,7 @@ class UsersCoursesDetail(SecureAPIView):
response_data
=
{}
response_data
=
{}
response_data
[
'uri'
]
=
base_uri
response_data
[
'uri'
]
=
base_uri
try
:
try
:
user
=
User
.
objects
.
get
(
id
=
user_id
,
is_active
=
True
)
user
=
User
.
objects
.
get
(
id
=
user_id
)
except
ObjectDoesNotExist
:
except
ObjectDoesNotExist
:
return
Response
({},
status
=
status
.
HTTP_404_NOT_FOUND
)
return
Response
({},
status
=
status
.
HTTP_404_NOT_FOUND
)
if
not
course_exists
(
request
,
user
,
course_id
):
if
not
course_exists
(
request
,
user
,
course_id
):
...
@@ -896,7 +896,7 @@ class UsersCoursesDetail(SecureAPIView):
...
@@ -896,7 +896,7 @@ class UsersCoursesDetail(SecureAPIView):
DELETE /api/users/{user_id}/courses/{course_id}
DELETE /api/users/{user_id}/courses/{course_id}
"""
"""
try
:
try
:
user
=
User
.
objects
.
get
(
id
=
user_id
,
is_active
=
True
)
user
=
User
.
objects
.
get
(
id
=
user_id
)
except
ObjectDoesNotExist
:
except
ObjectDoesNotExist
:
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
if
not
course_exists
(
request
,
user
,
course_id
):
if
not
course_exists
(
request
,
user
,
course_id
):
...
...
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