From ebda0fb4ef434d264c35f1a2dcb43da6e055d1d1 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Wed, 25 Jul 2018 19:20:53 +0200 Subject: [PATCH] Getting form from all application types in MigrateCommand class. --- opentech/apply/funds/management/commands/migration_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opentech/apply/funds/management/commands/migration_base.py b/opentech/apply/funds/management/commands/migration_base.py index 1472e2df3..3014aef13 100644 --- a/opentech/apply/funds/management/commands/migration_base.py +++ b/opentech/apply/funds/management/commands/migration_base.py @@ -58,7 +58,12 @@ class MigrateCommand(BaseCommand): submission.page = FUND ROUND = Round.objects.get(title=self.ROUND_NAME) submission.round = ROUND - FORM = RoundForm.objects.get(round=ROUND) + if self.APPLICATION_TYPE == "request": + FORM = RoundForm.objects.get(round=ROUND) + elif self.APPLICATION_TYPE == "concept": + FORM = RoundForm.objects.filter(round=ROUND)[0] + elif self.APPLICATION_TYPE == "proposal": + FORM = RoundForm.objects.filter(round=ROUND)[1] submission.form_fields = FORM.form.form_fields elif self.CONTENT_TYPE == "lab": LAB = LabType.objects.get(title=self.LAB_NAME) -- GitLab