master
Aevann1 2021-07-28 13:00:15 +02:00
parent 108eb90e82
commit 00f8150f7d
3 changed files with 13 additions and 16 deletions

View File

@ -17,7 +17,6 @@ from drama.classes import *
from drama.classes.domains import reasons as REASONS
from flask import *
import matplotlib.pyplot as plt
from .front import frontlist
from drama.__main__ import app, cache
@ -568,7 +567,7 @@ def shadowban(user_id, v):
target_user_id=user.id,
)
g.db.add(ma)
cache.delete_memoized(frontlist)
return "", 204
@ -590,7 +589,7 @@ def unshadowban(user_id, v):
target_user_id=user.id,
)
g.db.add(ma)
cache.delete_memoized(frontlist)
return "", 204
@ -739,7 +738,7 @@ def ban_post(post_id, v):
g.db.add(post)
cache.delete_memoized(frontlist)
ma=ModAction(
kind="ban_post",
@ -773,7 +772,7 @@ def unban_post(post_id, v):
g.db.add(post)
cache.delete_memoized(frontlist)
return "", 204
@ -810,7 +809,7 @@ def api_sticky_post(post_id, v):
post.stickied = not (post.stickied)
g.db.add(post)
g.db.commit()
cache.delete_memoized(frontlist)
return "", 204

View File

@ -13,7 +13,6 @@ from drama.helpers.thumbs import *
from drama.helpers.alerts import send_notification
from drama.helpers.discord import send_message
from drama.classes import *
from .front import frontlist
from flask import *
from io import BytesIO
from drama.__main__ import app, limiter, cache
@ -60,7 +59,7 @@ def publish(pid, v):
if not post.author_id == v.id: abort(403)
post.private = False
g.db.add(post)
cache.delete_memoized(frontlist)
g.db.commit()
return "", 204
@ -941,7 +940,7 @@ def submit_post(v):
# spin off thumbnail generation and csam detection as new threads
if (new_post.url or request.files.get('file')) and (v.is_activated or request.headers.get('cf-ipcountry')!="T1"): thumbs(new_post)
cache.delete_memoized(frontlist)
cache.delete_memoized(User.userpagelisting)
g.db.commit()
@ -1061,7 +1060,7 @@ def delete_post_pid(pid, v):
g.db.add(post)
cache.delete_memoized(frontlist)
return "", 204
@ -1075,7 +1074,7 @@ def undelete_post_pid(pid, v):
if not post.author_id == v.id: abort(403)
post.deleted_utc =0
g.db.add(post)
cache.delete_memoized(frontlist)
return "", 204
@app.get("/embed/post/<pid>")

View File

@ -5,8 +5,7 @@ from drama.helpers.filters import filter_comment_html
from drama.helpers.markdown import *
from drama.helpers.discord import remove_user, set_nick
from drama.mail import *
from .front import frontlist
from drama.__main__ import app, cache
=from drama.__main__ import app, cache
import youtube_dl
valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
@ -159,7 +158,7 @@ def settings_profile_post(v):
def changelogsub(v):
v.changelogsub = not v.changelogsub
g.db.add(v)
cache.delete_memoized(frontlist)
return "", 204
@app.post("/settings/namecolor")
@ -460,7 +459,7 @@ def settings_block_user(v):
)
g.db.add(new_block)
cache.delete_memoized(frontlist)
existing = g.db.query(Notification).filter_by(blocksender=v.id, user_id=user.id).first()
if not existing: send_block_notif(v.id, user.id, f"@{v.username} has blocked you!")
@ -482,7 +481,7 @@ def settings_unblock_user(v):
g.db.delete(x)
cache.delete_memoized(frontlist)
existing = g.db.query(Notification).filter_by(unblocksender=v.id, user_id=user.id).first()
if not existing: send_unblock_notif(v.id, user.id, f"@{v.username} has unblocked you!")