Skip to content

Commit

Permalink
CLN
Browse files Browse the repository at this point in the history
  • Loading branch information
wabscale committed Aug 26, 2023
1 parent 25b7aa5 commit f7e52b2
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions api/anubis/views/public/forum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from flask import Blueprint
import json

from flask import Blueprint

from anubis.lms.forum import (
verify_post,
verify_post_owner,
Expand All @@ -11,13 +13,11 @@
ForumPost,
ForumPostComment,
ForumPostViewed,
StaticFile,
)
from flask import request
from anubis.utils.auth.http import require_user
from anubis.utils.auth.user import current_user
from anubis.utils.auth.user import verify_in_course
from anubis.utils.http import success_response, error_response
from anubis.utils.http import success_response
from anubis.utils.http.decorators import json_response, json_endpoint, load_from_id
from anubis.utils.http.files import process_file_upload

Expand Down Expand Up @@ -101,7 +101,7 @@ def public_post_forum_post(
db.session.commit()

return success_response({
'post': post.data,
'post': post.data,
'status': 'Posted',
})

Expand Down Expand Up @@ -134,7 +134,7 @@ def public_patch_forum_post(
db.session.commit()

return success_response({
'post': post.data,
'post': post.data,
'status': 'Post updated',
})

Expand All @@ -149,7 +149,7 @@ def public_delete_forum_post(post_id: str):
db.session.commit()

return success_response({
'status': 'Post deleted',
'status': 'Post deleted',
'variant': 'warning'
})

Expand All @@ -162,7 +162,7 @@ def public_get_forum_comment(comment: ForumPostComment):
verify_in_course(comment.post.course_id)
return success_response({
'comment': comment.data,
'post': comment.post.meta_data,
'post': comment.post.meta_data,
})


Expand Down Expand Up @@ -196,9 +196,9 @@ def public_post_forum_post_comment(
db.session.commit()

return success_response({
'post': post.data,
'post': post.data,
'comment': comment.data,
'status': 'Comment posted',
'status': 'Comment posted',
})


Expand All @@ -225,7 +225,7 @@ def public_patch_forum_post_comment(

return success_response({
'comment': comment.data,
'status': 'Comment updated',
'status': 'Comment updated',
})


Expand All @@ -239,13 +239,11 @@ def public_delete_forum_post_comment(comment_id: str):
db.session.commit()

return success_response({
'status': 'Comment deleted',
'status': 'Comment deleted',
'variant': 'warning',
})




@forum_.post('/image')
@require_user()
@json_response
Expand Down

0 comments on commit f7e52b2

Please sign in to comment.