Skip to content

Commit

Permalink
feature: removing create/update/destroy queue and sector via EDA
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJaeger committed Sep 21, 2023
1 parent 7812c4e commit bdb6a52
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
10 changes: 0 additions & 10 deletions chats/apps/api/v1/queues/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ModelViewSet

from chats.apps.api.v1.internal.eda_clients.flows_eda_client import FlowsEDAClient
from chats.apps.api.v1.internal.rest_clients.flows_rest_client import FlowRESTClient
from chats.apps.api.v1.permissions import AnyQueueAgentPermission, IsSectorManager
from chats.apps.api.v1.queues import serializers as queue_serializers
Expand Down Expand Up @@ -57,9 +56,6 @@ def perform_create(self, serializer):
"name": instance.name,
"sector_uuid": str(instance.sector.uuid),
}
if settings.USE_EDA:
FlowsEDAClient().request_queue(action="", content=content)
return
if not settings.USE_WENI_FLOWS:
return super().perform_create(serializer)
response = FlowRESTClient().create_queue(**content)
Expand All @@ -77,9 +73,6 @@ def perform_update(self, serializer):
"name": instance.name,
"sector_uuid": str(instance.sector.uuid),
}
if settings.USE_EDA:
FlowsEDAClient().request_queue(action="", content=content)
return

if not settings.USE_WENI_FLOWS:
return super().perform_create(serializer)
Expand All @@ -97,9 +90,6 @@ def perform_destroy(self, instance):
"sector_uuid": str(instance.sector.uuid),
}

if settings.USE_EDA:
FlowsEDAClient().request_queue(action="", content=content)
return super().perform_destroy(instance)
if not settings.USE_WENI_FLOWS:
return super().perform_destroy(instance)

Expand Down
6 changes: 1 addition & 5 deletions chats/apps/api/v1/sectors/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response

from chats.apps.api.v1.internal.eda_clients.flows_eda_client import FlowsEDAClient

from chats.apps.api.v1.internal.rest_clients.connect_rest_client import (
ConnectRESTClient,
)
Expand Down Expand Up @@ -75,9 +73,7 @@ def perform_create(self, serializer):
"sector_uuid": str(instance.uuid),
},
}
if settings.USE_EDA:
FlowsEDAClient().request_ticketer(content=content)
return

if settings.USE_WENI_FLOWS:
connect = ConnectRESTClient()
response = connect.create_ticketer(**content)
Expand Down

0 comments on commit bdb6a52

Please sign in to comment.