From 387bff70fb41bf7be7d316f9cf0aae95958b16dc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 5 Sep 2018 18:32:18 +0200 Subject: QA edit find: better management of fields --- ishtar_common/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common/forms.py') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 4300e9c36..106b68c14 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -642,11 +642,15 @@ class ManageOldType(IshtarForm): class QAForm(CustomForm, ManageOldType): MULTI = False + SINGLE_FIELDS = [] def __init__(self, *args, **kwargs): self.items = kwargs.pop('items') super(QAForm, self).__init__(*args, **kwargs) - for k in self.fields: + for k in self.fields.keys(): + if self.MULTI and k in self.SINGLE_FIELDS: + self.fields.pop(k) + continue if self.MULTI and k not in self.REPLACE_FIELDS: self.fields[k].label = unicode(self.fields[k].label) + \ unicode(u" - append to existing") -- cgit v1.2.3