-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add basic spam handler #27
Conversation
def mark_spam(post_id, id): | ||
comments = Comment.query.get(int(id)) | ||
comments.is_spam = True | ||
db.session.commit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perlu db.session.add(comment)
ga sih ?
gw masih awam sqlalchemy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nggak, kalau add kan insert
@comment.route("/comment/<int:post_id>/<int:id>", methods=["GET"]) | ||
@requires_roles("admin", "momod") | ||
def mark_spam(post_id, id): | ||
comments = Comment.query.get(int(id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oiya ini cuma satu, harusnya comment
aja instead of comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh takut overwrite blueprint nya ya...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
Oiya karena kita munculin commentnya recursive, kalau comment marked as spam, reply nya jadi ikut ga muncul karena ga ada parent nya. Expected begini atau mau gimana ? |
harusnya ketika komentar spam di delete, childnya ga muncul. karena kalau muncul dia jadi out scope ya? |
btw ane kelupaan keknya, kalau dimark spam harusnya dia kaga keitung waktu di viewnya. jadi total comment yang tampil adalah komen yang bukan spam. bener ga sih? |
Tapi kalo gitu kesian juga sih yg reply tapi ga muncul. |
hmm boleh juga tuh idenya, ya udah ane benerin dulu |
No description provided.