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 )