backend/app/views/base.py
def post(self, request, format=None):
        """A view to report the progress to the user."""
        data = self.serialize(request)
        job = django_rq.get_queue("default").fetch_job(data.job_id)
        if job is None:
            return Response(dict(success=False, error="Unknown job ID."))
        job_status = job.get_status()
        success, error = True, ""
        if job_status == "failed":
            success = False
            error = 'There was an uncaught internal error during solving.'
            # print (job.__dict__)
        return Response(
            dict(
                success=success,
                status=job_status,
                error=error,
                progress_data=job.meta.get('progress_data', None),
                result=job.result
            ),
            status=status.HTTP_200_OK
        )
A view to report the progress to the user.
A view to report the progress to the user.
A view to report the progress to the user .
def post(self, request, format=None):
        data = self.serialize(request)
        job = django_rq.get_queue("default").fetch_job(data.job_id)
        if job is None:
            return Response(dict(success=False, error="Unknown job ID."))
        job_status = job.get_status()
        success, error = True, ""
        if job_status == "failed":
            success = False
            error = 'There was an uncaught internal error during solving.'
        return Response(
            dict(
                success=success,
                status=job_status,
                error=error,
                progress_data=job.meta.get('progress_data', None),
                result=job.result
            ),
            status=status.HTTP_200_OK
        )
def post ( self , request , format = None ) : data = self . serialize ( request ) job = django_rq . get_queue ( "default" ) . fetch_job ( data . job_id ) if job is None : return Response ( dict ( success = False , error = "Unknown job ID." ) ) job_status = job . get_status ( ) success , error = True , "" if job_status == "failed" : success = False error = 'There was an uncaught internal error during solving.' return Response ( dict ( success = success , status = job_status , error = error , progress_data = job . meta . get ( 'progress_data' , None ) , result = job . result ) , status = status . HTTP_200_OK )
A view to report the progress to the user.
A view to report the progress to the user .
"""A view to report the progress to the user.""" # print (job.__dict__)
self
request
format