<commit_before>from django import template

register = template.Library()

NO_PLACE_ORGS = ('parliament', 'national-assembly', )
MEMBER_ORGS = ('parliament', 'national-assembly', )


@register.assignment_tag()
def should_display_place(organisation):
    return organisation.slug not in NO_PLACE_ORGS


@register.assignment_tag()
def should_display_position(organisation, position_title):
    should_display = True

    if organisation.slug in MEMBER_ORGS and unicode(position_title) in (u'Member',):
        should_display = False
<commit_msg>[ZA] Fix display of people on constituency office page<commit_after>from django import template

register = template.Library()

NO_PLACE_ORGS = ('parliament', 'national-assembly', )
MEMBER_ORGS = ('parliament', 'national-assembly', )


@register.assignment_tag()
def should_display_place(organisation):
    if not organisation:
        return True
    return organisation.slug not in NO_PLACE_ORGS


@register.assignment_tag()
def should_display_position(organisation, position_title):
    should_display = True

    if organisation.slug in MEMBER_ORGS and unicode(position_title) in (u'Member',):
        should_display = False

{'fraction_non_alphanumeric': 0.0947098976109215, 'fraction_numerical': 0.0, 'mean_word_length': 5.516666666666667, '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': '7245439', 'n_tokens_mistral': 353, 'n_tokens_neox': 341, 'n_words': 85}