diff --git a/fowl/game/models.py b/fowl/game/models.py index ad81353..9de55ec 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -248,7 +248,7 @@ class Match(models.Model): for star in title_teams[self.title_at_stake ].members.all(): points[star.id] += 1 - elif not battle_royal and len(title_teams) == 1: + elif not battle_royal: # look over titles in match, to score a title-nondefense for title, title_team in title_teams.iteritems(): # beat someone w/ title in a non-defense @@ -311,7 +311,7 @@ class League(models.Model): oldtimer_picks = models.IntegerField(default=2) def score_event(self, event): - ppv_bonus = 1 if event.name.lower() not in ('raw', 'smackdown') else 0 + ppv_bonus = 1 if event.name.lower() not in ('raw', 'smackdown', 'main event') else 0 TeamPoints.objects.filter(match__event=event).delete() for match in event.matches.all(): for star, points in match.points().iteritems(): diff --git a/fowl/game/tests.py b/fowl/game/tests.py index ea7a148..6b0bd72 100644 --- a/fowl/game/tests.py +++ b/fowl/game/tests.py @@ -375,7 +375,9 @@ class LeagueTest(TestCase): 'password') self.user2 = User.objects.create_user('me2', 'test@example.com', 'password') - self.league = League.objects.create(name='FOWL') + self.league = League.objects.create(name='FOWL', + start_date='2010-01-01', + end_date='2013-01-01') self.teddy = Team.objects.create(name='Team Teddy', login=self.user, league=self.league) self.johnny = Team.objects.create(name='Team Johnny', login=self.user2, diff --git a/fowl/game/views.py b/fowl/game/views.py index 1b9aea9..c94c6d1 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -110,7 +110,7 @@ def league(request, league_id): 'wwe': {'name': None, 'points': 0, 'date': None, 'teams': {team: 0 for team in teams}}, } - belt_mapping = {'smackdown': 'ic', 'raw': 'us'} + belt_mapping = {'smackdown': 'ic', 'raw': 'us', 'main event': 'ic'} # go over all events in order to determine belt holders for event in Event.objects.filter(date__gte=league.start_date,