Skip to content

Commit

Permalink
fix tags post data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mubangizi committed Jul 30, 2024
1 parent 728af18 commit 18dbd77
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/controllers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ def post(self):
message=f'cluster {cluster_id} not found'
), 404

tags = None
if validated_project_data.get('tags_add'):
tags = validated_project_data['tags_add']
validated_project_data.pop('tags_add', None)

kube_host = cluster.host
kube_token = cluster.token

Expand Down Expand Up @@ -134,11 +139,6 @@ def post(self):
user_id=project.owner_id
)
project.users.append(new_role)

tags = None
if validated_project_data.get('tags_add'):
tags = validated_project_data['tags']
validated_project_data.pop('tags', None)

saved = project.save()

Expand Down Expand Up @@ -506,7 +506,7 @@ def patch(self, project_id):
current_user_roles = get_jwt_claims()['roles']

project_schema = ProjectSchema(
only=("name", "description", "organisation", "project_type", "is_public","tags_add", "tags_remove"), partial=True)
only=("name", "description", "organisation", "project_type", "is_public", "tags_add", "tags_remove"), partial=True)

project_data = request.get_json()

Expand Down

0 comments on commit 18dbd77

Please sign in to comment.