Exemple #1
0
    def get(self, request, *args, **kwargs):
        if Criterion.objects.filter(parent__isnull=True).count() == 0 or \
                Criterion.objects.filter(parent__isnull=False).count() == 0 or\
                Supplier.objects.count() == 0:
            # no data
            return HttpResponseRedirect(reverse('home'))

        report = Report.create_report(request.user)
        return HttpResponseRedirect(
            reverse('criterion-score', args=[report.id]))