<commit_before>"""Templatetags for the newsletter app."""
from django import template

from .. import settings

register = template.Library()


@register.simple_tag(takes_context=True)
def has_seen_modal(context):
    if getattr(settings, 'FORCE_MODAL', False):
        return ''
    context['request'].session['has_seen_newsletter_signup_modal'] = True
    return ''<commit_msg>Re-setting the state of the modal to not shown when forcing the modal<commit_after>"""Templatetags for the newsletter app."""
from django import template

from .. import settings

register = template.Library()


@register.simple_tag(takes_context=True)
def has_seen_modal(context):
    if getattr(settings, 'FORCE_MODAL', False):
        context['request'].session['has_seen_newsletter_signup_modal'] = False
    else:
        context['request'].session['has_seen_newsletter_signup_modal'] = True
    return ''
{'fraction_non_alphanumeric': 0.1124859392575928, 'fraction_numerical': 0.0, 'mean_word_length': 5.223776223776224, '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': '1455846', 'n_tokens_mistral': 263, 'n_tokens_neox': 258, 'n_words': 64}