@staticmethod
    def response_data_cleanup(domain):
        rule_count = AutomaticUpdateRule.objects.filter(
            domain=domain.name,
            deleted=False,
            active=True,
        ).count()
        if rule_count > 0:
            return _fmt_alert(
                ungettext(
                    "You have %(rule_count)d automatic case update rule "
                    "configured in your project. If you select this plan, "
                    "this rule will be deactivated.",
                    "You have %(rule_count)d automatic case update rules "
                    "configured in your project. If you select this plan, "
                    "these rules will be deactivated.",
                    rule_count
                ) % {
                    'rule_count': rule_count,
                }
            )
Any active automatic case update rules should be deactivated.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/accounting/subscription_changes.py/DomainDowngradeStatusHandler.response_data_cleanup