Skip to content

Commit

Permalink
Merge pull request #1848 from Bidaya0/fix/1.16.0/project_current_vers…
Browse files Browse the repository at this point in the history
…ion_change

fix: project current version auth fix.
  • Loading branch information
Bidaya0 authored Sep 22, 2023
2 parents 4526276 + 289d411 commit 64c7ab7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dongtai_web/views/project_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class ProjectSearch(UserEndPoint):
)
def get(self, request):
name = request.query_params.get("name", "")
users = self.get_auth_users(request.user)
projects = IastProject.objects.filter(user__in=users, name__icontains=name).order_by("-latest_time")
projects = request.user.get_projects().filter(name__icontains=name).order_by("-latest_time")
data = [model_to_dict(project, fields=["id", "name"]) for project in projects]
return R.success(data=data)
5 changes: 2 additions & 3 deletions dongtai_web/views/project_version_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ def post(self, request):
if not version_id or not project_id:
return R.failure(status=202, msg=_("Parameter error"))

users = self.get_auth_users(request.user)
users_id = [user.id for user in users]
projects = request.user.get_projects()
version = IastProjectVersion.objects.filter(
project_id=project_id, id=version_id, user_id__in=users_id
project_id=project_id, id=version_id, project__in=projects
).first()
if version:
version.current_version = 1
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class VulSummary(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class VulSummaryProject(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vul_summary_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class VulSummaryType(UserEndPoint):
"Use the following conditions to view the statistics of the number of vulnerabilities in the project."
),
response_schema=_ResponseSerializer,
deprecated=True,
)
def get(self, request):
"""
Expand Down
1 change: 1 addition & 0 deletions dongtai_web/views/vuls.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class VulsEndPoint(UserEndPoint):
summary=_("Vulnerability List (with project)"),
response_schema=_ResponseSerializer,
description=_("Get the list of vulnerabilities corresponding to the project"),
deprecated=True,
)
def get(self, request):
"""
Expand Down

0 comments on commit 64c7ab7

Please sign in to comment.