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
068e02ef
Commit
068e02ef
authored
Apr 22, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make unflag all permissions match javascript
parent
3f1d97b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lms/djangoapps/django_comment_client/base/views.py
+5
-4
No files found.
lms/djangoapps/django_comment_client/base/views.py
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
()))
...
...
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