From 9665cf059134f1fc11b1986f5df0dcffbbdb9b42 Mon Sep 17 00:00:00 2001 From: johnyrahul Date: Sun, 10 Mar 2024 22:08:40 +0530 Subject: [PATCH] Profile maanager migration fixes --- .../migrations/0008_profilemanager_migration.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/prompt_studio/prompt_profile_manager/migrations/0008_profilemanager_migration.py b/backend/prompt_studio/prompt_profile_manager/migrations/0008_profilemanager_migration.py index c703139afd..a00397d524 100644 --- a/backend/prompt_studio/prompt_profile_manager/migrations/0008_profilemanager_migration.py +++ b/backend/prompt_studio/prompt_profile_manager/migrations/0008_profilemanager_migration.py @@ -30,6 +30,10 @@ def MigrateProfileManager(apps: Any, schema_editor: Any) -> None: which has distinct profile manager.""" for index, custom_prompt in enumerate(custom_prompts): + """There can be scenario where individual prompts wont have a + profile manager attached.""" + if not custom_prompt.profile_manager: + continue profile_manager = ProfileManager.objects.get( pk=custom_prompt.profile_manager.profile_id )