[WEB-2359] chore: handled the project id in issue type (#973)

* chore: handled the project in issue type

* chore: removed the exception
This commit is contained in:
Bavisetti Narayan
2024-09-02 15:15:31 +05:30
committed by GitHub
parent 8588da5e63
commit cbeb7408fa
4 changed files with 6 additions and 7 deletions

View File

@@ -148,7 +148,7 @@ class InboxIssueAPIEndpoint(BaseAPIView):
# Get the issue type
issue_type = IssueType.objects.filter(
project_id=project_id, is_default=True
project_issue_types__project_id=project_id, is_default=True
).first()
# create an issue

View File

@@ -45,7 +45,7 @@ def member_sync_task(slug):
member["user_id"] = str(member["user_id"])
# Send request to payment server to sync workspace members
response = requests.patch(
_ = requests.patch(
f"{settings.PAYMENT_SERVER_BASE_URL}/api/workspaces/{workspace_id}/subscriptions/",
json={
"slug": slug,
@@ -58,8 +58,6 @@ def member_sync_task(slug):
},
)
response.raise_for_status()
# Refresh workspace license
resync_workspace_license(slug, force=True)
else:

View File

@@ -365,12 +365,12 @@ class IssueCreateSerializer(BaseSerializer):
if issue_type_id:
# Check if issue type is valid
issue_type = IssueType.objects.filter(
project_id=project_id, id=issue_type_id
project_issue_types__project_id=project_id, id=issue_type_id
).first()
else:
# Get default issue type
issue_type = IssueType.objects.filter(
project_id=project_id, is_default=True
project_issue_types__project_id=project_id, is_default=True
).first()
issue = Issue.objects.create(

View File

@@ -157,7 +157,8 @@ class InboxIssuePublicViewSet(BaseViewSet):
)
issue_type = IssueType.objects.filter(
project_id=project_deploy_board.project_id, is_default=True
project_issue_types__project_id=project_deploy_board.project_id,
is_default=True,
).first()
# create an issue