No more removing reports

This commit is contained in:
Julian Rota 2022-05-23 00:35:26 -04:00
parent 286cc4e2fb
commit 4b6aa40960
2 changed files with 1 additions and 28 deletions

View file

@ -63,33 +63,6 @@ def api_flag_comment(cid, v):
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>')
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)

View file

@ -66,7 +66,7 @@
<pre></pre>
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
{% 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 %}
</ul>
</div>