diff options
-rw-r--r-- | ishtar_common/wizards.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 180ed4618..5f3d440e4 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -477,10 +477,12 @@ class Wizard(NamedUrlWizardView): value['history_modifier'] = self.request.user value = model.objects.create(**value) value.save() - getattr(obj, key + 's').add(value) - # necessary to manage interaction between models like - # material_index management for baseitems - obj.save() + # check that an item is not add multiple times (forged forms) + if value not in getattr(obj, key + 's').all(): + getattr(obj, key + 's').add(value) + # necessary to manage interaction between models like + # material_index management for baseitems + obj.save() dct = {'item': obj} # force evaluation of lazy urls wizard_done_window = unicode(self.wizard_done_window) |