chore: user workspace api modification#6547
chore: user workspace api modification#6547sangeethailango merged 3 commits intofeat-enchanced-workspace-switcherfrom
Conversation
WalkthroughThis update modifies the workspace data structure by removing the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Endpoint as UserWorkSpacesEndpoint
participant DB as WorkspaceMember Database
participant Serializer as WorkSpaceSerializer
Client->>Endpoint: GET /user/workspaces
Endpoint->>DB: Query workspaces with role (filter by user & active status)
DB-->>Endpoint: Return workspace member data with role
Endpoint->>Serializer: Serialize workspace data with new role field
Serializer-->>Endpoint: Return serialized data
Endpoint-->>Client: Response with updated workspace info
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apiserver/plane/app/serializers/workspace.py (1)
49-57: Removeownerfromread_only_fields.The
ownerfield has been removed from the serializer but is still listed inread_only_fields. This could cause confusion for future maintenance.Apply this diff to remove the redundant field:
read_only_fields = [ "id", "created_by", "updated_by", "created_at", "updated_at", - "owner", "logo_url", ]apiserver/plane/app/views/workspace/base.py (1)
178-181: Fix line length to comply with PEP 8.The line exceeds the maximum line length of 88 characters.
Apply this diff to fix the line length:
role = ( - WorkspaceMember.objects.filter(workspace=OuterRef("id"), member=request.user, is_active=True) + WorkspaceMember.objects.filter( + workspace=OuterRef("id"), + member=request.user, + is_active=True + ) .values("role") )🧰 Tools
🪛 Ruff (0.8.2)
179-179: Line too long (105 > 88)
(E501)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apiserver/plane/app/serializers/workspace.py(1 hunks)apiserver/plane/app/views/workspace/base.py(3 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
apiserver/plane/app/views/workspace/base.py
179-179: Line too long (105 > 88)
(E501)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
8623bea
into
feat-enchanced-workspace-switcher
Description
This PR will return the user role in the user workspace API.
Summary by CodeRabbit