diff --git a/fowl/game/templates/base.html b/fowl/game/templates/base.html index cc418a2..76b03a8 100644 --- a/fowl/game/templates/base.html +++ b/fowl/game/templates/base.html @@ -44,6 +44,7 @@ diff --git a/fowl/game/templates/edit_event.html b/fowl/game/templates/edit_event.html index 84131af..5f8a8ce 100644 --- a/fowl/game/templates/edit_event.html +++ b/fowl/game/templates/edit_event.html @@ -2,6 +2,7 @@ {% block content %}
+ diff --git a/fowl/game/views.py b/fowl/game/views.py index 9457eaf..5901e33 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -55,6 +55,15 @@ def edit_event(request, event): edict['matches'][int(match)-1]['teams'].append(v) event = Event.from_dict(edict) + # score the event for all active leagues + for league in League.objects.filter(active=True): + league.score_event(event) + # after event is scored, do title change on all matches + for match in event.matches.all(): + match.do_title_change() + # TODO: title changes should take place inline somehow? + # (would fix for case if title changes twice) + event = event.to_dict() return render(request, "edit_event.html", {'event': event,