Skip to content

Commit

Permalink
feature: org field in project and passing project uuid when creating …
Browse files Browse the repository at this point in the history
…a queue (#416)
  • Loading branch information
AlanJaeger authored Nov 13, 2024
1 parent 8509017 commit 01fa462
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chats/apps/api/v1/internal/rest_clients/flows_rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def retry_request_and_refresh_flows_auth_token(


class FlowsQueueMixin:
def create_queue(self, uuid: str, name: str, sector_uuid: str):
def create_queue(self, uuid: str, name: str, sector_uuid: str, project_uuid: str):
response = requests.post(
url=f"{self.base_url}/api/v2/internals/ticketers/{sector_uuid}/queues/",
headers=self.headers,
json={"uuid": uuid, "name": name},
json={"uuid": uuid, "name": name, "project_uuid": project_uuid},
)
if response.status_code not in [
status.HTTP_200_OK,
Expand Down
1 change: 1 addition & 0 deletions chats/apps/api/v1/queues/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def perform_create(self, serializer):
"uuid": str(instance.uuid),
"name": instance.name,
"sector_uuid": str(instance.sector.uuid),
"project_uuid": str(instance.sector.project.uuid),
}
if not settings.USE_WENI_FLOWS:
return super().perform_create(serializer)
Expand Down
20 changes: 20 additions & 0 deletions chats/apps/projects/migrations/0020_project_org.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.1.2 on 2024-10-29 18:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("projects", "0019_flowstart_contact_data"),
]

operations = [
migrations.AddField(
model_name="project",
name="org",
field=models.CharField(
blank=True, max_length=50, null=True, verbose_name="org uuid"
),
),
]
1 change: 1 addition & 0 deletions chats/apps/projects/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Project(BaseConfigurableModel, BaseModel):
null=True,
blank=True,
)
org = models.CharField(_("org uuid"), max_length=50, null=True, blank=True)

class Meta:
verbose_name = _("Project")
Expand Down

0 comments on commit 01fa462

Please sign in to comment.