def clean(self):
        """
        Raise a validation error if there are already 5 data sources and this
        report won't be able to use one of the existing ones.
        """
        cleaned_data = super(DataSourceForm, self).clean()

        existing_reports = ReportConfiguration.by_domain(self.domain)
        builder_reports = filter(lambda report: report.report_meta.created_by_builder, existing_reports)
        if 5 >= len(builder_reports) and not UNLIMITED_REPORT_BUILDER_REPORTS.enabled(self.domain):
            raise forms.ValidationError(_(
                "Too many reports!\n"
                "Creating this report would cause you to go over the maximum "
                "number of report builder reports allowed in this domain. The current "
                "limit is 5. "
                "To continue, delete another report and try again. "
            ))

        return cleaned_data
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/userreports/reports/builder/forms.py/DataSourceForm.clean/swapped operands of `>=`