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
068e02ef
Commit
068e02ef
authored
11 years ago
by
Your Name
Browse files
Options
Downloads
Patches
Plain Diff
make unflag all permissions match javascript
parent
3f1d97b0
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/django_comment_client/base/views.py
+5
-4
5 additions, 4 deletions
lms/djangoapps/django_comment_client/base/views.py
with
5 additions
and
4 deletions
lms/djangoapps/django_comment_client/base/views.py
+
5
−
4
View file @
068e02ef
...
...
@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
from
django.contrib.auth.models
import
User
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
courseware.courses
import
get_course_with_access
from
courseware.courses
import
get_course_with_access
,
get_course_by_id
from
course_groups.cohorts
import
get_cohort_id
,
is_commentable_cohorted
from
django_comment_client.utils
import
JsonResponse
,
JsonError
,
extract
,
get_courseware_context
...
...
@@ -299,9 +299,9 @@ def flag_abuse_for_thread(request, course_id, thread_id):
@permitted
def
un_flag_abuse_for_thread
(
request
,
course_id
,
thread_id
):
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
course
=
get_course_by_id
(
course_id
)
thread
=
cc
.
Thread
.
find
(
thread_id
)
removeAll
=
cached_has_permission
(
request
.
user
,
'
openclose_thread
'
,
course_id
)
removeAll
=
cached_has_permission
(
request
.
user
,
'
openclose_thread
'
,
course_id
)
or
has_access
(
request
.
user
,
course
,
'
staff
'
)
thread
.
unFlagAbuse
(
user
,
thread
,
removeAll
)
return
JsonResponse
(
utils
.
safe_content
(
thread
.
to_dict
()))
...
...
@@ -321,7 +321,8 @@ def flag_abuse_for_comment(request, course_id, comment_id):
@permitted
def
un_flag_abuse_for_comment
(
request
,
course_id
,
comment_id
):
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
removeAll
=
cached_has_permission
(
request
.
user
,
'
openclose_thread
'
,
course_id
)
course
=
get_course_by_id
(
course_id
)
removeAll
=
cached_has_permission
(
request
.
user
,
'
openclose_thread
'
,
course_id
)
or
has_access
(
request
.
user
,
course
,
'
staff
'
)
comment
=
cc
.
Comment
.
find
(
comment_id
)
comment
.
unFlagAbuse
(
user
,
comment
,
removeAll
)
return
JsonResponse
(
utils
.
safe_content
(
comment
.
to_dict
()))
...
...
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