fix comment after signal moderation
This commit is contained in:
parent
eeed2fe503
commit
df947f9523
3 changed files with 14 additions and 2 deletions
|
|
@ -31,8 +31,18 @@ def main():
|
|||
if group == settings.SIGNAL_MODERATORS_GROUP:
|
||||
if emoji == "👍" and target_author == settings.SIGNAL_ACCOUNT:
|
||||
if source in settings.SIGNAL_MODERATORS:
|
||||
from ..item import models
|
||||
from ..item import models, tasks
|
||||
now = timezone.now()
|
||||
try:
|
||||
comment = models.Comment.objects.filter(data__moderator_ts=target_ts).first()
|
||||
if comment:
|
||||
link = settings.URL + comment.item.get_absolute_url()
|
||||
msg = '%s commented on <b>%s</b> at <a href="%s">%s</a>' % (
|
||||
comment.name, comment.item.title, link, link
|
||||
)
|
||||
tasks.notify_telegram.delay(msg)
|
||||
except:
|
||||
pass
|
||||
models.Comment.objects.filter(data__moderator_ts=target_ts).update(published=now)
|
||||
rpc.send_reaction(target_author, target_ts, "🎉", group=group)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue