diff options
Diffstat (limited to 'archaeological_context_records/wizards.py')
-rw-r--r-- | archaeological_context_records/wizards.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py index afed15c4e..60dab44d6 100644 --- a/archaeological_context_records/wizards.py +++ b/archaeological_context_records/wizards.py @@ -34,6 +34,7 @@ class RecordWizard(Wizard): step = self.steps.current if not step: return + # manage manualy on creation if step.endswith('_creation'): # an operation has been selected main_form_key = 'selec-' + self.url_name try: @@ -46,21 +47,16 @@ class RecordWizard(Wizard): if current_cr: return current_cr.operation - # get_template_context def get_context_data(self, form, **kwargs): """ Get the operation "reminder" on top of wizard forms """ context = super(RecordWizard, self).get_context_data(form) + operation = self.get_current_operation() - if not operation: + if not operation or self.steps.current.startswith('selec-'): return context - items = [] - if hasattr(operation, 'code_patriarche') and operation.code_patriarche: - items.append(unicode(operation.code_patriarche)) - items.append("-".join((unicode(operation.year), - unicode(operation.operation_code)))) - context['reminder'] = _("Current operation: ") + " - ".join(items) + context['reminders'] = ((_("Operation"), unicode(operation)),) return context def get_form(self, step=None, data=None, files=None): |