Skip to content

Commit

Permalink
commit merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJaeger committed Feb 4, 2025
1 parent 7750855 commit 33d19d8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions chats/apps/projects/usecases/integrate_ticketers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@

class IntegratedTicketers:
def integrate_ticketer(self, project):
projects = Project.objects.filter(org=project.org).exclude(
config__its_principal=True
)
projects = Project.objects.filter(org=project.org, config__its_secundary=True)

for secundary_project in projects:
sectors = Sector.objects.filter(
project=project, config__integration_token=secundary_project.uuid
project=project, config__integration_token=str(secundary_project.uuid)
)

for sector in sectors:
Expand All @@ -40,13 +38,12 @@ def integrate_ticketer(self, project):
)

def integrate_topic(self, project):
projects = Project.objects.filter(org=project.org).exclude(
config__its_principal=True
)
projects = Project.objects.filter(org=project.org, config__its_secundary=True)

for secundary_project in projects:
queues = Queue.objects.filter(
sector__project=project,
sector__project__config__integration_token=secundary_project.uuid,
sector__project__config__integration_token=str(secundary_project.uuid),
)

for queue in queues:
Expand All @@ -68,7 +65,7 @@ def integrate_topic(self, project):
def integrate_individual_ticketer(self, project, integrated_token):
try:
sector = Sector.objects.get(
project=project, config__integration_token=integrated_token
project=project, config__integration_token=str(integrated_token)
)
content = {
"project_uuid": str(sector.config.get("integration_token")),
Expand Down Expand Up @@ -96,7 +93,7 @@ def integrate__individual_topic(self, project, sector_integrated_token):
try:
queue = Queue.objects.filter(
sector__project=project,
sector__project__config__integration_token=sector_integrated_token,
sector__project__config__integration_token=str(sector_integrated_token),
)
content = {
"uuid": str(queue.uuid),
Expand Down

0 comments on commit 33d19d8

Please sign in to comment.