Skip to content

Commit

Permalink
Remove rest api for Lead preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rup-Narayan-Rajbanshi committed Sep 27, 2024
1 parent 5af11f6 commit e87804f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
23 changes: 0 additions & 23 deletions apps/lead/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,29 +304,6 @@ class Meta:
fields = ('id', 'file',)


class LeadPreviewSerializer(RemoveNullFieldsMixin,
DynamicFieldsMixin, serializers.ModelSerializer):
"""
Serializer for lead preview
"""

text = serializers.CharField(source='leadpreview.text_extract',
read_only=True)
images = LeadPreviewAttachmentSerializer(many=True, read_only=True)
classified_doc_id = serializers.IntegerField(
source='leadpreview.classified_doc_id',
read_only=True,
)
preview_id = serializers.IntegerField(
source='leadpreview.pk',
read_only=True,
)

class Meta:
model = Lead
fields = ('id', 'preview_id', 'text', 'images', 'classified_doc_id')


class LeadGroupSerializer(RemoveNullFieldsMixin,
DynamicFieldsMixin, UserResourceSerializer):
leads = LeadSerializer(source='lead_set',
Expand Down
10 changes: 0 additions & 10 deletions apps/lead/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
LeadGroupSerializer,
SimpleLeadGroupSerializer,
LeadSerializer,
LeadPreviewSerializer,
check_if_url_exists,
LeadOptionsSerializer,
LeadOptionsBodySerializer,
Expand Down Expand Up @@ -237,15 +236,6 @@ def leads_filter(self, request, version=None):
return response


class LeadPreviewViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = LeadPreviewSerializer
permission_classes = [permissions.IsAuthenticated,
ModifyPermission]

def get_queryset(self):
return Lead.get_for(self.request.user)


class LeadOptionsView(views.APIView):
"""
Options for various attributes related to lead
Expand Down
3 changes: 0 additions & 3 deletions deep/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
from lead.views import (
LeadGroupViewSet,
LeadViewSet,
LeadPreviewViewSet,
LeadOptionsView,
LeadExtractionTriggerView,
LeadWebsiteFetch,
Expand Down Expand Up @@ -254,8 +253,6 @@
basename='lead_group')
router.register(r'leads', LeadViewSet,
basename='lead')
router.register(r'lead-previews', LeadPreviewViewSet,
basename='lead_preview')

# Questionnaire routers
router.register(r'questionnaires/(?P<questionnaire_id>\d+)/questions',
Expand Down

0 comments on commit e87804f

Please sign in to comment.