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
2 changes: 1 addition & 1 deletion apps/api/plane/app/views/estimate/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def partial_update(self, request, slug, project_id, estimate_id):
status=status.HTTP_400_BAD_REQUEST,
)

estimate = Estimate.objects.get(pk=estimate_id)
estimate = Estimate.objects.get(pk=estimate_id, workspace__slug=slug, project_id=project_id)

if request.data.get("estimate"):
estimate.name = request.data.get("estimate").get("name", estimate.name)
Expand Down
2 changes: 1 addition & 1 deletion apps/api/plane/app/views/project/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def partial_update(self, request, slug, pk=None):

workspace = Workspace.objects.get(slug=slug)

project = Project.objects.get(pk=pk)
project = Project.objects.get(pk=pk, workspace__slug=slug)
Comment thread
NarayanBavisetti marked this conversation as resolved.
intake_view = request.data.get("inbox_view", project.intake_view)
current_instance = json.dumps(ProjectSerializer(project).data, cls=DjangoJSONEncoder)
if project.archived_at:
Expand Down
9 changes: 7 additions & 2 deletions apps/api/plane/app/views/workspace/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,16 @@ def get(self, request, slug):

class WorkspaceUserProfileEndpoint(BaseAPIView):
def get(self, request, slug, user_id):
user_data = User.objects.get(pk=user_id)

requesting_workspace_member = WorkspaceMember.objects.get(
workspace__slug=slug, member=request.user, is_active=True
)

# Verify the target user is also an active member of this workspace
# before exposing their profile data.
target_workspace_member = WorkspaceMember.objects.select_related("member").get(
workspace__slug=slug, member_id=user_id, is_active=True
)
user_data = target_workspace_member.member
projects = []
if requesting_workspace_member.role >= 15:
projects = (
Expand Down
Loading