From 31f74fa0106ed461d0086ff03efe45cc47c61f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sun, 20 May 2018 16:43:53 +0200 Subject: [PATCH] Fix stupid mistakes. --- .../0005_add_teams_to_categories.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/info/migrations/0005_add_teams_to_categories.py b/src/info/migrations/0005_add_teams_to_categories.py index 9baf4b04..e4aa33b0 100644 --- a/src/info/migrations/0005_add_teams_to_categories.py +++ b/src/info/migrations/0005_add_teams_to_categories.py @@ -9,22 +9,22 @@ def add_teams_to_categories(apps, schema_editor): Camp = apps.get_model("camps", "Camp") # 2016 - Everything is orga team - camp2016 = Camp.objects.filter(slug="bornhack-2016") - orga2016 = Team.objects.filter(camp=camp2016, name="Orga") + camp2016 = Camp.objects.get(slug="bornhack-2016") + orga2016 = Team.objects.get(camp=camp2016, name="Orga") InfoCategory.objects.filter(camp=camp2016).update(team=orga2016) # 2017 - Everything is orga team - camp2017 = Camp.objects.filter(slug="bornhack-2017") - orga2017 = Team.objects.filter(camp=camp2017, name="Orga") + camp2017 = Camp.objects.get(slug="bornhack-2017") + orga2017 = Team.objects.get(camp=camp2017, name="Orga") InfoCategory.objects.filter(camp=camp2017).update(team=orga2017) # 2018 - Map categories to teams - camp2018 = Camp.objects.filter(slug="bornhack-2018") + camp2018 = Camp.objects.get(slug="bornhack-2018") team2018 = Team.objects.filter(camp=camp2018) infocategories2018 = InfoCategory.objects.filter(camp=camp2018) # Info team - infoteam = team2018.filter(name="Info") + infoteam = team2018.get(name="Info") info_anchors = [ "what", "when", @@ -40,23 +40,23 @@ def add_teams_to_categories(apps, schema_editor): infocategories2018.filter(anchor__in=info_anchors).update(team=infoteam) # Food team - food = team2018.filter(name="Food") + food = team2018.get(name="Food") infocategories2018.filter(anchor_in=["food-and-groceries"]).update(team=food) # NOC team - noc = team2018.filter(name="NOC") + noc = team2018.get(name="NOC") infocategories2018.filter(anchor__in=["network"]).update(team=noc) # Power team - power = team2018.filter(name="Power") + power = team2018.get(name="Power") infocategories2018.filter(anchor__in=["power"]).update(team=power) # Shuttle bus - shuttle_bus = team2018.filter(name="Shuttle Bus") + shuttle_bus = team2018.get(name="Shuttle Bus") infocategories2018.filter(anchor__in=["shuttle-bus"]).update(team=shuttle_bus) # Bar - bar = team2018.filter(name="Bar") + bar = team2018.get(name="Bar") infocategories2018.filter(anchor__in=["bar"]).update(team=bar) @@ -67,5 +67,5 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPyton(add_teams_to_categories) + migrations.RunPython(add_teams_to_categories) ]