From 200b7f7930622d2cfb1b020393dd0bd19ea2baaf Mon Sep 17 00:00:00 2001 From: poduck Date: Fri, 28 Nov 2025 21:50:22 -0500 Subject: [PATCH] fix: Include platform plugins in marketplace and fix serializer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: 1. Updated PluginTemplateViewSet.get_queryset() to include PLATFORM visibility plugins in marketplace view alongside approved PUBLIC plugins 2. Fixed PluginTemplateListSerializer read_only_fields from string '__all__' to proper list reference Platform plugins are now visible in the marketplace API: - 6 platform-created plugins seeded via seed_platform_plugins command - Categories: EMAIL, REPORTS, CUSTOMER, BOOKING - All marked as visibility=PLATFORM, is_approved=True 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- smoothschedule/schedule/serializers.py | 2 +- smoothschedule/schedule/views.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/smoothschedule/schedule/serializers.py b/smoothschedule/schedule/serializers.py index 3cbe53c..81d73a5 100644 --- a/smoothschedule/schedule/serializers.py +++ b/smoothschedule/schedule/serializers.py @@ -632,7 +632,7 @@ class PluginTemplateListSerializer(serializers.ModelSerializer): 'install_count', 'rating_average', 'rating_count', 'created_at', 'updated_at', 'published_at', ] - read_only_fields = '__all__' + read_only_fields = fields # All fields are read-only for list view class PluginInstallationSerializer(serializers.ModelSerializer): diff --git a/smoothschedule/schedule/views.py b/smoothschedule/schedule/views.py index edc6ee4..4d21584 100644 --- a/smoothschedule/schedule/views.py +++ b/smoothschedule/schedule/views.py @@ -642,10 +642,11 @@ class PluginTemplateViewSet(viewsets.ModelViewSet): view_mode = self.request.query_params.get('view', 'marketplace') if view_mode == 'marketplace': - # Public marketplace - only approved public templates + # Public marketplace - platform official + approved public templates + from django.db.models import Q queryset = queryset.filter( - visibility=PluginTemplate.Visibility.PUBLIC, - is_approved=True + Q(visibility=PluginTemplate.Visibility.PLATFORM) | + Q(visibility=PluginTemplate.Visibility.PUBLIC, is_approved=True) ) elif view_mode == 'my_plugins': # User's own templates