Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: org field in project and passing project uuid when creating … #416

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading