feat: When attempting to create and objetc must be unique and alrready exists, dont return error return existing object
ref: #855
This commit is contained in:
@ -18,6 +18,10 @@ from api.viewsets.common import ModelViewSet
|
||||
summary = 'Create a Feature Flag',
|
||||
description='',
|
||||
responses = {
|
||||
200: OpenApiResponse(
|
||||
description='Already exists',
|
||||
response = ViewSerializer
|
||||
),
|
||||
201: OpenApiResponse(description='Created', response=ViewSerializer),
|
||||
403: OpenApiResponse(description='User is missing add permissions'),
|
||||
}
|
||||
|
@ -22,6 +22,10 @@ from api.viewsets.common import ModelViewSet
|
||||
summary = 'Create a GIT Group',
|
||||
description='Create',
|
||||
responses = {
|
||||
200: OpenApiResponse(
|
||||
description='Already exists',
|
||||
response = ViewSerializer
|
||||
),
|
||||
201: OpenApiResponse(
|
||||
description='Created. Will be serialized with the serializer matching the provider.',
|
||||
response = ViewSerializer
|
||||
|
@ -60,6 +60,18 @@ from api.viewsets.common import (
|
||||
many = False,
|
||||
),
|
||||
responses = {
|
||||
200: OpenApiResponse(
|
||||
description='Already exists',
|
||||
response=PolymorphicProxySerializer(
|
||||
component_name = 'Git Provider',
|
||||
serializers=[
|
||||
GitHubViewSerializer,
|
||||
GitLabViewSerializer,
|
||||
],
|
||||
resource_type_field_name=None,
|
||||
many = False,
|
||||
),
|
||||
),
|
||||
201: OpenApiResponse(
|
||||
description='Created. Will be serialized with the serializer matching the provider.',
|
||||
response=PolymorphicProxySerializer(
|
||||
|
@ -17,6 +17,10 @@ from itam.models.software import Software
|
||||
summary = 'Enable Feature Flagging for Software',
|
||||
description='',
|
||||
responses = {
|
||||
200: OpenApiResponse(
|
||||
description='Already exists',
|
||||
response = ViewSerializer
|
||||
),
|
||||
201: OpenApiResponse(description='Created', response=ViewSerializer),
|
||||
403: OpenApiResponse(description='User is missing add permissions'),
|
||||
}
|
||||
|
Reference in New Issue
Block a user