From 21fc0f481da2f079ae42f21976d32a8bc75ecd05 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 13 Feb 2019 23:46:30 +0100 Subject: Fix migration on new DB - fix filter field when no gis db is available --- ishtar_common/forms.py | 3 ++- ishtar_common/migrations/0081_recreate_m2m_history.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 0bb97b980..57f48ff95 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -554,7 +554,8 @@ class IshtarForm(forms.Form, BSForm): for profile_key in self.PROFILE_FILTER: if not getattr(profile, profile_key): for field_key in self.PROFILE_FILTER[profile_key]: - self.fields.pop(field_key) + if field_key in self.fields.keys(): + self.fields.pop(field_key) if getattr(self, 'confirm', False): return for field in self.TYPES: diff --git a/ishtar_common/migrations/0081_recreate_m2m_history.py b/ishtar_common/migrations/0081_recreate_m2m_history.py index 3d7f28bb6..3cbe5cdbc 100644 --- a/ishtar_common/migrations/0081_recreate_m2m_history.py +++ b/ishtar_common/migrations/0081_recreate_m2m_history.py @@ -41,5 +41,4 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(recreate_m2m_migrations) ] -- cgit v1.2.3