@staticmethod
    def checkreport(planid, stamp):
        try:
            plan = Plan.objects.get(pk=planid)
        except:
            return 'error'

        tempdir = settings.WEB_TEMP
        filename = '%s_p%d_v%d_%s' % (plan.owner.username, plan.id, plan.version, stamp)
        pending_file = '%s/%s.pending' % (tempdir, filename)
        complete_file = '%s/%s.html' % (tempdir, filename)
        
        if os.path.exists(complete_file):
            if os.path.exists(pending_file):
                os.unlink(pending_file)
            return 'ready'

        if os.path.exists(pending_file):
            return 'busy'
        
        return 'free'
Check on the status of a calculator report.
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/tasks.py/CalculatorReport.checkreport