From 0ac37178ffd48b45ea13bbf7bc814682808134d0 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sat, 26 May 2012 11:57:05 -0400 Subject: [PATCH] fix the win by DQ in title defense case --- fowl/game/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fowl/game/models.py b/fowl/game/models.py index a246605..f657fee 100644 --- a/fowl/game/models.py +++ b/fowl/game/models.py @@ -1,3 +1,4 @@ +from collections import defaultdict from django.db import models from django.contrib import admin from django.contrib.auth.models import User @@ -88,7 +89,7 @@ class Match(models.Model): def points(self): - points = {} + points = defaultdict(int) winners = self.teams.filter(victorious=True) if winners: @@ -143,7 +144,7 @@ class Match(models.Model): points[w.id] += 20 else: points[w.id] += 10 - elif self.title_at_stake and self.win_type != 'DQ': + elif self.title_at_stake and self.win_type == 'DQ': for star in self.teams.get(title=t).members.all(): points[star.id] += 1 # beat tag champs in tag match w/o tag belt on line