feat: add community contribution ranks

This commit is contained in:
2026-09-29 22:18:57 +03:30
parent 0f6220f72c
commit 77567178ad
46 changed files with 2206 additions and 23 deletions

View File

@@ -374,6 +374,9 @@ class Comment(BaseModel):
moderation_note=note,
updated_at=now,
)
from apps.gamification.services import sync_comment
for comment in self.__class__.all_objects.filter(id__in=ids).select_related("author", "post"):
sync_comment(comment)
def unhide(self):
now = timezone.now()
@@ -386,6 +389,9 @@ class Comment(BaseModel):
moderation_note="",
updated_at=now,
)
from apps.gamification.services import sync_comment
for comment in self.__class__.all_objects.filter(id__in=ids).select_related("author", "post"):
sync_comment(comment)
def descendant_ids(self) -> list[int]:
pending = [self.id]
@@ -408,6 +414,9 @@ class Comment(BaseModel):
delete_note=note,
updated_at=now,
)
from apps.gamification.services import sync_comment
for comment in self.__class__.all_objects.filter(id__in=ids).select_related("author", "post"):
sync_comment(comment)
class Like(models.Model):