feat: add community contribution ranks
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user