Exemplo n.º 1
0
 def handle(self, *args, **options):
     game = most_recent_game()
     unused_tokens = SignupInvite.objects.filter(game=game,
                                                 used_at__isnull=True)
     for token in unused_tokens:
         path = reverse('signup', args=[token.id])
         url = f'https://uwhvz.uwaterloo.ca{path}'
         send_signup_reminder(None, token.email, url, game)
Exemplo n.º 2
0
    def handle(self, *args, **options):
        game = most_recent_game()
        spectators = Spectator.objects.filter(game=game)
        moderators = Moderator.objects.filter(game=game)
        humans = Player.objects.filter(game=game,
                                       active=True,
                                       role=PlayerRole.HUMAN)

        spectator_emails = [s.user.email for s in spectators]
        moderator_emails = [m.user.email for m in moderators]
        human_emails = [h.user.email
                        for h in humans] + spectator_emails + moderator_emails
        print(", ".join(human_emails))
Exemplo n.º 3
0
    def handle(self, *args, **options):
        game = most_recent_game()
        spectators = Spectator.objects.filter(game=game)
        moderators = Moderator.objects.filter(game=game)
        zombies = Player.objects.filter(game=game,
                                        active=True,
                                        role=PlayerRole.ZOMBIE)

        spectator_emails = [s.user.email for s in spectators]
        moderator_emails = [m.user.email for m in moderators]
        zombie_emails = [z.user.email for z in zombies
                         ] + spectator_emails + moderator_emails
        print(", ".join(zombie_emails))
Exemplo n.º 4
0
    def handle(self, *args, **options):
        path = Path(options['path'])

        if not path.exists():
            raise CommandError(f'The path {path} does not exist.')
        game = most_recent_game()
        locations = SignupLocation.objects.filter(game=game)

        with open(path, 'rb') as csv_file:
            reader = csv.DictReader(codecs.iterdecode(csv_file, 'utf-8'),
                                    ['email', 'location'])
            for row in reader:
                try:
                    self.process_row(row, game, locations)
                except Exception as e:
                    print(f'Error: {e}')
Exemplo n.º 5
0
 def handle(self, *args, **options):
     game = most_recent_game()
     participants = get_game_participants(game)
     participant_emails = [p.user.email for p in participants]
     print(", ".join(participant_emails))