Skip to content

Commit

Permalink
Add missing enrich_story in tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
andreymal committed Jul 3, 2023
1 parent 5f31395 commit c12e461
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mini_fiction/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pony.orm import db_session

from mini_fiction import models
from mini_fiction.bl.migration import enrich_story
from mini_fiction.models import Story, Chapter
from mini_fiction.utils.misc import render_nonrequest_template, ping_sitemap

Expand Down Expand Up @@ -171,6 +172,8 @@ def notify_story_pubrequest(story_id, author_id):
if not author:
return

enrich_story(story)

ctx = {
'story': story,
'author': author,
Expand All @@ -194,6 +197,8 @@ def notify_story_publish_noappr(story_id, author_id):
if not author:
return

enrich_story(story)

staff = models.Author.select(lambda x: x.is_staff)
recipients = [u.email for u in staff if u.email and 'story_publish_noappr' not in u.silent_email_list]
_sendmail_notify(recipients, 'story_publish_noappr', {'story': story, 'author': author})
Expand Down Expand Up @@ -236,6 +241,8 @@ def notify_story_publish_draft(story_id, staff_id, draft, fast=False):
if not author or not staff:
return

enrich_story(story)

typ = 'story_draft' if draft else 'story_publish'

if typ not in author.silent_tracker_list:
Expand All @@ -252,6 +259,8 @@ def notify_author_story(story_id, publisher_user_id=None):
if not story:
return

enrich_story(story)

# Получаем авторов и соавторов
author_ids = [x.id for x in story.bl.get_authors()]

Expand Down

0 comments on commit c12e461

Please sign in to comment.