[WEB-4281] chore: project error message updated (#7190)
* chore: project error message updated * fix: error message for project creation * fix: incorrect error code * chore: code refactor * chore: code refactor --------- Co-authored-by: sangeethailango <sangeethailango21@gmail.com>
This commit is contained in:
parent
2014400bed
commit
0983e5f44d
21 changed files with 65 additions and 14 deletions
|
|
@ -341,7 +341,10 @@ class ProjectViewSet(BaseViewSet):
|
|||
except IntegrityError as e:
|
||||
if "already exists" in str(e):
|
||||
return Response(
|
||||
{"name": "The project name is already taken"},
|
||||
{
|
||||
"name": "The project name is already taken",
|
||||
"code": "PROJECT_NAME_ALREADY_EXIST",
|
||||
},
|
||||
status=status.HTTP_409_CONFLICT,
|
||||
)
|
||||
except Workspace.DoesNotExist:
|
||||
|
|
@ -350,7 +353,10 @@ class ProjectViewSet(BaseViewSet):
|
|||
)
|
||||
except serializers.ValidationError:
|
||||
return Response(
|
||||
{"identifier": "The project identifier is already taken"},
|
||||
{
|
||||
"identifier": "The project identifier is already taken",
|
||||
"code": "PROJECT_IDENTIFIER_ALREADY_EXIST",
|
||||
},
|
||||
status=status.HTTP_409_CONFLICT,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue