summaryrefslogtreecommitdiff
path: root/ishtar_common/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-21 22:49:29 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-21 22:49:29 +0200
commitcca497f2b81fa6d7d7797953afda2bcffea8e066 (patch)
treeb58ea191ef3cb985ed7d1c75ad60273128652638 /ishtar_common/wizards.py
parent68e9e65081a102186c9ddf7b0caed0edb8f83561 (diff)
downloadIshtar-cca497f2b81fa6d7d7797953afda2bcffea8e066.tar.bz2
Ishtar-cca497f2b81fa6d7d7797953afda2bcffea8e066.zip
Django 1.11: adapt all get_field_* to match the current Options API
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r--ishtar_common/wizards.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index a82b68d5b..5217eafae 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -40,7 +40,9 @@ from django.shortcuts import render_to_response, redirect
from django.template import Context, RequestContext, loader
from django.utils.datastructures import MultiValueDict as BaseMultiValueDict
from django.utils.translation import ugettext_lazy as _
-import models
+
+from ishtar_common import models
+from ishtar_common.utils import get_all_field_names
logger = logging.getLogger(__name__)
@@ -528,7 +530,7 @@ class Wizard(NamedUrlWizardView):
for k in dct:
if k.startswith('pk'):
continue
- if k not in obj.__class__._meta.get_all_field_names():
+ if k not in get_all_field_names(obj.__class__):
continue
# False set to None for images and files
if not k.endswith('_id') and (
@@ -608,7 +610,7 @@ class Wizard(NamedUrlWizardView):
if 'pk' in dct:
dct.pop('pk')
# remove non relevant fields
- all_field_names = self.get_saved_model()._meta.get_all_field_names()
+ all_field_names = get_all_field_names(self.get_saved_model())
for k in dct.copy():
if not (k.endswith('_id') and k[:-3] in all_field_names) \
and k not in all_field_names and \