add main event and fix an issue w/ champ vs champ matches
This commit is contained in:
parent
da303edb04
commit
6676164462
@ -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():
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user