Skip to content

Commit

Permalink
Merge pull request #224 from wmgeolab/workspaces_fix_slashes
Browse files Browse the repository at this point in the history
Workspaces fix slashes
  • Loading branch information
devsaxena974 authored Oct 1, 2024
2 parents 804f6c3 + dd8cb92 commit d377cc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/scopeBackend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,11 @@ def create(self, request):
# create workspace and add creator to workspace
serializer = self.get_serializer(data=request.data)


if any(c in request.data['name'] for c in ['/', '\\', '"']):
return Response({'error':'Name contains illegal characters'}, status=status.HTTP_400_BAD_REQUEST)


serializer.is_valid(raise_exception=True)
serializer.save(creatorId=self.request.user)
headers = self.get_success_headers(serializer.data)
Expand Down

0 comments on commit d377cc8

Please sign in to comment.