<commit_before>from django.core.management.base import NoArgsCommand

from pinax.apps.signup_codes.models import SignupCode
from privatebeta.models import WaitingList


class Command(NoArgsCommand):
    args = '<poll_id poll_id ...>'
    help = 'Closes the specified poll for voting'

    def handle_noargs(self, **options):
        count = 0
        for wl in WaitingList.objects.filter(invited=False):
            SignupCode.create(wl.email, 24 * 14, group=self.group)

            wl.invited = True
            wl.save()

            count += 1

        print "Invited %s Users" % count<commit_msg>make sure we send the email out when we invite a user<commit_after>from django.core.management.base import NoArgsCommand

from pinax.apps.signup_codes.models import SignupCode
from privatebeta.models import WaitingList


class Command(NoArgsCommand):
    args = '<poll_id poll_id ...>'
    help = 'Closes the specified poll for voting'

    def handle_noargs(self, **options):
        count = 0
        for wl in WaitingList.objects.filter(invited=False):
            sc = SignupCode.create(wl.email, 24 * 14)
            sc.send()

            wl.invited = True
            wl.save()

            count += 1

        print "Invited %s Users" % count
{'fraction_non_alphanumeric': 0.09192645883293366, 'fraction_numerical': 0.009592326139088728, 'mean_word_length': 2.577142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1372897', 'n_tokens_mistral': 386, 'n_tokens_neox': 359, 'n_words': 105}