Skip to content

Commit

Permalink
Merge pull request #43 from ImMin5/master
Browse files Browse the repository at this point in the history
Fix public and private dashboard name check role
  • Loading branch information
ImMin5 authored Jan 3, 2024
2 parents a0c3040 + 5ff15fe commit 23d81df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/spaceone/dashboard/model/private_dashboard_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class PrivateDashboard(MongoModel):
@classmethod
def create(cls, data):
dashboard_vos = cls.filter(
name=data["name"], user_id=data["user_id"], domain_id=data["domain_id"]
name=data["name"],
user_id=data["user_id"],
project_id=data["project_id"],
workspace_id=data["workspace_id"],
domain_id=data["domain_id"],
)

if dashboard_vos.count() > 0:
Expand Down
7 changes: 6 additions & 1 deletion src/spaceone/dashboard/model/public_dashboard_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ class PublicDashboard(MongoModel):

@classmethod
def create(cls, data):
dashboard_vos = cls.filter(name=data["name"], domain_id=data["domain_id"])
dashboard_vos = cls.filter(
name=data["name"],
project_id=data["project_id"],
workspace_id=data["workspace_id"],
domain_id=data["domain_id"],
)

if dashboard_vos.count() > 0:
raise ERROR_NOT_UNIQUE(key="name", value=data["name"])
Expand Down

0 comments on commit 23d81df

Please sign in to comment.