diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-01 19:06:35 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-01 19:06:35 +0200 |
commit | 71672e712570bf33b55cb534e2776ef8a1251755 (patch) | |
tree | 9c277f0f6fdd5ae6a42b0f7201c96c75ca0f7bdf /archaeological_operations/wizards.py | |
parent | 08ad687cf6ca9f4aa9aff625370df24a6a94dea6 (diff) | |
download | Ishtar-71672e712570bf33b55cb534e2776ef8a1251755.tar.bz2 Ishtar-71672e712570bf33b55cb534e2776ef8a1251755.zip |
Operation wizard: an operation cannot be related to herself (refs #3578)
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r-- | archaeological_operations/wizards.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 5410b37f8..c132c24be 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-2017 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -275,6 +275,15 @@ class OperationModificationWizard(OperationWizard): modification = True filter_owns = {'selec-operation_modification': ['pk']} + def get_form_kwargs(self, step, **kwargs): + kwargs = super(OperationModificationWizard, self).get_form_kwargs( + step, **kwargs) + print(step) + if step != "relations-operation_modification": + return kwargs + kwargs["left_record"] = self.get_current_object() + return kwargs + class OperationClosingWizard(ClosingWizard): model = models.Operation |