@receiver(core_signals.can_create_object)
def check_object_limit(sender, context, object_type, **kwargs):
    if context.__class__.__name__ == "User":
        if parameters.get_admin("ENABLE_ADMIN_LIMITS") == "no":
            return
        if context.is_superuser:
            return True
        limit = context.userobjectlimit_set.get(name=object_type)
    elif context.__class__.__name__ == "Domain":
        if parameters.get_admin("ENABLE_DOMAIN_LIMITS") == "no":
            return
        limit = context.domainobjectlimit_set.get(name=object_type)
    else:
        raise NotImplementedError
    count = kwargs.get("count", 1)
    if limit.is_exceeded(count):
        raise lib.LimitReached(limit)
Return a formula representation of a LDM instruction.
dataset/ETHPy150Open tonioo/modoboa/modoboa/limits/handlers.py/check_object_limit--crossover with--dataset/ETHPy150Open programa-stic/barf-project/barf/barf/core/smt/smttranslator.py/SmtTranslator._translate_ldm