From 90cf8ba77bbf5cd7203fee43ee1273680b574d80 Mon Sep 17 00:00:00 2001 From: zziminally Date: Sat, 29 Nov 2025 12:37:17 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=B4=20=EC=84=9C=EC=9E=AC=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=97=85=EB=A1=9C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dstonylion/AI/views.py | 6 ++++++ Dstonylion/story/views.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Dstonylion/AI/views.py b/Dstonylion/AI/views.py index 6e8d642..34dc001 100644 --- a/Dstonylion/AI/views.py +++ b/Dstonylion/AI/views.py @@ -28,6 +28,7 @@ from .models import * from .serializers import * +from mylibrary.models import * from story.models import Story, StoryPage, Illustrations from story.serializers import * from story.utils import split_into_pages @@ -1284,6 +1285,11 @@ def post(self, request, story_id): illustration_style=request.data.get("illustration_style") or original.illustration_style ) + Library.objects.get_or_create( + user=request.user, + story=new_story, + ) + pages = split_into_pages(combined_content) for idx, page_text in enumerate(pages, start=1): StoryPage.objects.create( diff --git a/Dstonylion/story/views.py b/Dstonylion/story/views.py index 2c15c29..0e20a71 100644 --- a/Dstonylion/story/views.py +++ b/Dstonylion/story/views.py @@ -499,6 +499,11 @@ def post(self, request): custom_theme, _ = MoralTheme.objects.get_or_create(name=kw, defaults={"key": f"custom_{kw}"}) story.morals.add(custom_theme) + Library.objects.get_or_create( + user=request.user, + story=story, + ) + pages = split_into_pages(body) for id, page_text in enumerate(pages, start=1):