Skip to content
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: 1 addition & 3 deletions apiserver/plane/api/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ def patch(self, request, slug, pk):
ProjectSerializer(project).data, cls=DjangoJSONEncoder
)

intake_view = request.data.get(
"inbox_view", request.data.get("intake_view", False)
)
intake_view = request.data.get("inbox_view", project.intake_view)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix parameter name mismatch: "inbox_view" vs "intake_view"

The code retrieves "inbox_view" from request data but the model uses "intake_view". This inconsistency could cause the toggle to fail silently.

-            intake_view = request.data.get("inbox_view", project.intake_view)
+            intake_view = request.data.get("intake_view", project.intake_view)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
intake_view = request.data.get("inbox_view", project.intake_view)
intake_view = request.data.get("intake_view", project.intake_view)


if project.archived_at:
return Response(
Expand Down
4 changes: 1 addition & 3 deletions apiserver/plane/app/views/project/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,9 @@ def partial_update(self, request, slug, pk=None):
)

workspace = Workspace.objects.get(slug=slug)
intake_view = request.data.get(
"inbox_view", request.data.get("intake_view", False)
)

project = Project.objects.get(pk=pk)
intake_view = request.data.get("inbox_view", project.intake_view)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent parameter naming between request and model

The code uses "inbox_view" in the request data but "intake_view" in the model and subsequent operations. This inconsistency could lead to confusion and potential bugs.

Apply this change to maintain consistent naming:

-intake_view = request.data.get("inbox_view", project.intake_view)
+intake_view = request.data.get("intake_view", project.intake_view)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
intake_view = request.data.get("inbox_view", project.intake_view)
intake_view = request.data.get("intake_view", project.intake_view)

current_instance = json.dumps(
ProjectSerializer(project).data, cls=DjangoJSONEncoder
)
Expand Down