Skip to content

Commit

Permalink
changes more
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmed authored and Taimoor Ahmed committed Feb 26, 2025
1 parent 3cfcaac commit 444c6e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def save(self, params=None):
self._update_from_response(response)
self.after_save(self)

def delete(self, course_id=None):
def delete(self):
course_key = get_course_key(self.attributes.get("course_id"))
if is_forum_v2_enabled(course_key):
response = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def flagAbuse(self, user, voteable):
url = _url_for_flag_abuse_thread(voteable.id)
else:
raise utils.CommentClientRequestError("Can only flag/unflag threads or comments")
course_key = utils.get_course_key(self.attributes.get("course_id") or course_id)
course_key = utils.get_course_key(self.attributes.get("course_id"))
if is_forum_v2_enabled(course_key):
response = forum_api.update_thread_flag(voteable.id, "flag", user_id=user.id, course_id=str(course_key))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def unfollow(self, source):
metric_tags=self._metric_tags + [f'target.type:{source.type}'],
)

def vote(self, voteable, value,):
def vote(self, voteable, value):
if voteable.type == 'thread':
url = _url_for_vote_thread(voteable.id)
elif voteable.type == 'comment':
url = _url_for_vote_comment(voteable.id)
else:
raise utils.CommentClientRequestError("Can only vote / unvote for threads or comments")
course_key = utils.get_course_key(self.attributes.get("course_id") or course_id)
course_key = utils.get_course_key(self.attributes.get("course_id"))
if is_forum_v2_enabled(course_key):
if voteable.type == 'thread':
response = forum_api.update_thread_votes(
Expand All @@ -121,7 +121,7 @@ def vote(self, voteable, value,):
)
voteable._update_from_response(response)

def unvote(self, voteable, course_id=None):
def unvote(self, voteable):
if voteable.type == 'thread':
url = _url_for_vote_thread(voteable.id)
elif voteable.type == 'comment':
Expand Down

0 comments on commit 444c6e8

Please sign in to comment.