* invisibleify completely removed trees only (fixes #431) * fix visibility state for shadowbanned users. this also ends up moving some of the complexity out of the templates. * comments: remove unused variable * moderation state machine * no seriously this really should check for v not being None * fix shadowban state * fix visibility state * update stateful counters * don't use bespoke function for show_descendants * properly mock ModerationState for cron submissions * fix approval discrepency * remove treenukes for removed comments * show shadowbans as removed
This commit is contained in:
parent
77af24a5b1
commit
39ce6a4ee9
9 changed files with 167 additions and 62 deletions
|
@ -11,7 +11,7 @@ from files.helpers.assetcache import assetcache_path
|
|||
from files.helpers.config.const import *
|
||||
from files.helpers.config.environment import (SCORE_HIDING_TIME_HOURS, SITE,
|
||||
SITE_FULL, SITE_ID)
|
||||
from files.helpers.content import body_displayed
|
||||
from files.helpers.content import ModerationState, body_displayed
|
||||
from files.helpers.lazy import lazy
|
||||
from files.helpers.time import format_age, format_datetime
|
||||
|
||||
|
@ -360,3 +360,7 @@ class Submission(CreatedBase):
|
|||
@property
|
||||
def edit_url(self) -> str:
|
||||
return f"/edit_post/{self.id}"
|
||||
|
||||
@property
|
||||
def moderation_state(self) -> ModerationState:
|
||||
return ModerationState.from_submittable(self)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue