<commit_before>from django import template


register = template.Library()


@register.filter
def get_available_modules_for_case_list_configuration(app, module):
    return [
        m for m in app.get_modules()
        if (m.id != module.id
            and m.module_type not in ('reports', 'careplan')
            and m.case_type == module.case_type)
    ]
<commit_msg>fix module type and use explicit reference to class property<commit_after>from django import template
from corehq.apps.app_manager.models import ReportModule, CareplanModule


register = template.Library()


@register.filter
def get_available_modules_for_case_list_configuration(app, module):
    # necessary to instantiate these because the class attributes are jsonobject.StringProperty's
    # that don't support equality checks
    disallowed_module_types = (ReportModule().module_type, CareplanModule().module_type)
    return [
        m for m in app.get_modules()
        if (m.id != module.id
            and m.module_type not in disallowed_module_types
            and m.case_type == module.case_type)
    ]

{'fraction_non_alphanumeric': 0.07727690892364306, 'fraction_numerical': 0.0, 'mean_word_length': 3.5523012552301254, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5997748', 'n_tokens_mistral': 308, 'n_tokens_neox': 299, 'n_words': 87}