]> git.ipfire.org Git - thirdparty/patchwork.git/commit
Fix failure to start with uninitalised database
authorDaniel Axtens <dja@axtens.net>
Tue, 9 Aug 2016 04:27:36 +0000 (14:27 +1000)
committerStephen Finucane <stephenfinucane@hotmail.com>
Sat, 20 Aug 2016 18:18:20 +0000 (19:18 +0100)
commit231966452f22dd344eabdd4f0722ce5463d1469a
treef00b68f2eb1b99d49fe1577625b757c5d7469b13
parentab5eb273f00a90bad035f6189b8fff7ac4d07fbf
Fix failure to start with uninitalised database

An OptionalModelChoiceField will attempt to query the database to get choices
in its __init__ method. This fails if the database hasn't been initialised
yet. So, put that in a try/catch block. This lets things work through the
migration and loading of data from fixtures.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
patchwork/forms.py