From a2fdd4a8609f58316d755a3b47705225d1159cd1 Mon Sep 17 00:00:00 2001 From: lakshmi2506 Date: Thu, 25 Jan 2024 08:21:35 +0000 Subject: [PATCH] updated the backednd call --- metecho/api/jobs.py | 6 +++--- metecho/api/models.py | 2 +- metecho/api/views.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/metecho/api/jobs.py b/metecho/api/jobs.py index 9d5befc99..84bb32cd4 100644 --- a/metecho/api/jobs.py +++ b/metecho/api/jobs.py @@ -646,17 +646,17 @@ def get_unsaved_changes(scratch_org, *, originating_user_id): ) get_unsaved_changes_job = job(get_unsaved_changes) -def get_nonsource_components(*,scratch_org,desired_type,originating_user_id): +def get_nonsource_components(*,scratch_org,desiredType,originating_user_id): try: scratch_org.refresh_from_db() with dataset_env(scratch_org) as (project_config, org_config, sf, schema, repo): components=ListComponents( org_config=org_config, project_config=project_config, - task_config=TaskConfig({"options":{"metadata_type":data}}), + task_config=TaskConfig({"options":{"metadata_type":desiredType}}), )() - scratch_org.metadatatype_changes[desired_type]=[cmp["MemberName"] for cmp in components] + scratch_org.metadatatype_changes[desiredType]=[cmp["MemberName"] for cmp in components] except Exception as e: scratch_org.refresh_from_db() diff --git a/metecho/api/models.py b/metecho/api/models.py index 0ef2e4c2f..f4dc376db 100644 --- a/metecho/api/models.py +++ b/metecho/api/models.py @@ -1481,7 +1481,7 @@ def queue_get_nonsource_components(self,*,originating_user_id,desiredType: str): self.currently_refreshing_changes = True self.save() self.notify_changed(originating_user_id=originating_user_id) - get_nonsource_components_job.delay(self,desired_type=desiredType,originating_user_id=originating_user_id) + get_nonsource_components_job.delay(self,desiredType=desiredType,originating_user_id=originating_user_id) def finalize_get_unsaved_changes(self, *, error=None, originating_user_id): self.currently_refreshing_changes = False diff --git a/metecho/api/views.py b/metecho/api/views.py index 792f59fbc..763d357b6 100644 --- a/metecho/api/views.py +++ b/metecho/api/views.py @@ -717,8 +717,7 @@ def listmetadata(self,request,pk=None): {"error": _("Requesting user did not create Org.")}, status=status.HTTP_403_FORBIDDEN, ) - logger.info(serializer.validated_data["desiredType"]) - scratch_org.queue_get_nonsource_components(**serializer.validated_data,originating_user_id=str(request.user.id)) + scratch_org.queue_get_nonsource_components(desiredType=serializer.validated_data["desiredType"],originating_user_id=str(request.user.id)) return Response( self.get_serializer(scratch_org).data, status=status.HTTP_202_ACCEPTED )