Skip to content

Commit

Permalink
Fix clone settings patch view (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored May 10, 2023
1 parent bcc7c9a commit df08314
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions apps/workspaces/apis/clone_settings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ def get_object(self):

return Workspace.objects.filter(id=latest_workspace.id).first()

def put(self, request, **kwargs):
workspace_instance = Workspace.objects.get(id=kwargs['workspace_id'])
serializer = CloneSettingsSerializer(workspace_instance, data=request.data, partial=True)

if serializer.is_valid(raise_exception=True):
serializer.save()
return Response(
data=serializer.data,
status=status.HTTP_200_OK
)


class CloneSettingsExistsView(generics.RetrieveAPIView):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def assert_4xx_cases(api_client, url, data):

assert response.status_code == 400

assert 'This field is required.' in str(response.data), 'clone settings api returns a diff in the message'
assert 'Settings are required' in str(response.data), 'clone settings api returns a diff in the message'


def test_clone_settings(api_client, test_connection):
Expand Down

0 comments on commit df08314

Please sign in to comment.