Skip to content

Commit

Permalink
Fix #60: Data source update endpoint is not working
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <george.padayatti@igrant.io>
  • Loading branch information
georgepadayatti committed Apr 7, 2024
1 parent af8752e commit 5e313c6
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions config/views.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import os
from django.http import JsonResponse, HttpResponse
from .serializers import (
DataSourceSerializer,
VerificationSerializer,
VerificationTemplateSerializer,
)
from .models import DataSource, Verification, ImageModel, VerificationTemplate
from rest_framework.views import APIView

import requests
from django.http import HttpResponse, JsonResponse
from rest_auth.serializers import PasswordChangeSerializer
from rest_auth.views import sensitive_post_parameters_m
from rest_framework import permissions, status
from rest_framework.generics import GenericAPIView
from rest_framework import status, permissions
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_auth.serializers import PasswordChangeSerializer
from rest_auth.views import sensitive_post_parameters_m
from onboard.serializers import DataspaceUserSerializer
from rest_framework.views import APIView

from connection.models import Connection
from dataspace_backend.settings import DATA_MARKETPLACE_DW_URL, DATA_MARKETPLACE_APIKEY
import requests
from dataspace_backend import settings
from dataspace_backend.settings import (DATA_MARKETPLACE_APIKEY,
DATA_MARKETPLACE_DW_URL)
from onboard.serializers import DataspaceUserSerializer

from .models import DataSource, ImageModel, Verification, VerificationTemplate
from .serializers import (DataSourceSerializer, VerificationSerializer,
VerificationTemplateSerializer)

# Create your views here.

Expand Down Expand Up @@ -157,7 +158,7 @@ def get(self, request):
return JsonResponse(response_data)

def put(self, request):
data = request.data.get("organisation", {})
data = request.data.get("dataSource", {})

# Get the DataSource instance associated with the current user
try:
Expand Down Expand Up @@ -523,4 +524,4 @@ def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response({"detail": "New password has been saved."})
return Response({"detail": "New password has been saved."}) return Response({"detail": "New password has been saved."})

0 comments on commit 5e313c6

Please sign in to comment.