No more removing reports
This commit is contained in:
parent
286cc4e2fb
commit
4b6aa40960
2 changed files with 1 additions and 28 deletions
|
@ -63,33 +63,6 @@ def api_flag_comment(cid, v):
|
||||||
return {"message": "Comment reported!"}
|
return {"message": "Comment reported!"}
|
||||||
|
|
||||||
|
|
||||||
@app.post('/del_report/post/<pid>/<uid>')
|
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
|
||||||
@admin_level_required(2)
|
|
||||||
def remove_report_post(v, pid, uid):
|
|
||||||
|
|
||||||
try:
|
|
||||||
pid = int(pid)
|
|
||||||
uid = int(uid)
|
|
||||||
except: abort(400)
|
|
||||||
|
|
||||||
report = g.db.query(Flag).filter_by(post_id=pid, user_id=uid).one()
|
|
||||||
|
|
||||||
g.db.delete(report)
|
|
||||||
|
|
||||||
ma=ModAction(
|
|
||||||
kind="delete_report",
|
|
||||||
user_id=v.id,
|
|
||||||
target_submission_id=pid
|
|
||||||
)
|
|
||||||
|
|
||||||
g.db.add(ma)
|
|
||||||
|
|
||||||
g.db.commit()
|
|
||||||
|
|
||||||
return {"message": "Report removed successfully!"}
|
|
||||||
|
|
||||||
|
|
||||||
@app.post('/del_report/comment/<cid>/<uid>')
|
@app.post('/del_report/comment/<cid>/<uid>')
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in p.flags(v) %}
|
{% for f in p.flags(v) %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue