<commit_before>from django.dispatch import receiver

from badger.signals import badge_was_awarded

from kitsune.kbadge.tasks import send_award_notification


@receiver(badge_was_awarded)
def notify_award_recipient(sender, **kwargs):
    """Notifies award recipient that he/she has an award!"""
    award = kwargs['award']

    # Kick off the task to send the email
    send_award_notification.delay(award)<commit_msg>[bug 920099] Don't send badge award emails on stage<commit_after>from django.conf import settings
from django.dispatch import receiver

from badger.signals import badge_was_awarded

from kitsune.kbadge.tasks import send_award_notification


@receiver(badge_was_awarded)
def notify_award_recipient(sender, award, **kwargs):
    """Notifies award recipient that he/she has an award!"""
    # -dev and -stage have STAGE = True which means they won't send
    # notification emails of newly awarded badges which would spam the
    # bejesus out of everyone.
    if not settings.STAGE:
        # Kick off the task to send the email
        send_award_notification.delay(award)
{'fraction_non_alphanumeric': 0.06985294117647059, 'fraction_numerical': 0.0055147058823529415, 'mean_word_length': 4.642487046632124, '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': '4705231', 'n_tokens_mistral': 341, 'n_tokens_neox': 321, 'n_words': 108}