Explorar o código

[api] No need to add operationId again in django_request.POST

- Using django_request.POST.copy() which is by default mutable and keeps the ontent and type same.
Harshg999 %!s(int64=4) %!d(string=hai) anos
pai
achega
ea7de2e833
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      desktop/core/src/desktop/api_public.py

+ 1 - 4
desktop/core/src/desktop/api_public.py

@@ -172,10 +172,7 @@ def _patch_operation_id_request(django_request):
   if not django_request.POST.get('snippet'):
     data['snippet'] = '{"type":"mysql","result":{}}'
 
-  if django_request.POST.get('operationId'):
-    data['operationId'] = django_request.POST.get('operationId')
-
-  django_request.POST = QueryDict(mutable=True)
+  django_request.POST = django_request.POST.copy() # Makes it mutable along with copying the object
   django_request.POST.update(data)