Skip to content

Commit

Permalink
Debug group non-unique group create error
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Jul 16, 2024
1 parent 61db13f commit a27083e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/api/specs/WorkflowsAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2267,16 +2267,6 @@ components:
- $ref: '#/components/schemas/TapisActorTask'
- $ref: '#/components/schemas/FunctionTask'
- $ref: '#/components/schemas/TemplateTask'
discriminator:
propertyName: type
mapping:
image_build: "#/components/schemas/ImageBuildTask"
request: "#/components/schemas/RequestTask"
application: "#/components/schemas/ApplicationTask"
tapis_job: "#/components/schemas/TapisJobTask"
tapis_actor: "#/components/schemas/TapisActorTask"
function: "#/components/schemas/FunctionTask"
template: "#/components/schemas/TemplateTask"

Task:
oneOf:
Expand Down
6 changes: 3 additions & 3 deletions src/api/src/backend/views/Groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def post(self, request, **_):
body = prepared_request.body

# Check that id of the group is unique
exists = Group.objects.filter(
id=body.id, tenant_id=request.tenant_id).exists()
if exists:
existing_group = Group.objects.filter(id=body.id, tenant_id=request.tenant_id).first()
print(model_to_dict(existing_group))
if existing_group != None:
return Conflict(f"A Group already exists with the id '{body.id}'")

# Save the Group object to the database
Expand Down

0 comments on commit a27083e

Please sign in to comment.