def _get_badge_type(self, **kwargs):
        form = FindTaskForBadgeForm(dict(
            project=kwargs['slug'], **self.request.GET.dict()
        ))
        if form.is_valid():
            try:
                last_task = form.get_task()
            except TaskDoesNotExists:
                return 'unknown'
            return {
                const.STATUS_NEW: 'unknown',
                const.STATUS_FAILED: 'fail',
                const.STATUS_SUCCESS: 'success',
            }[last_task['status']]
        return 'unknown'
Get badge type
dataset/ETHPy150Open nvbn/coviolations_web/projects/views.py/ProjectBadge._get_badge_type