diff options
Diffstat (limited to 'archaeological_operations/wizards.py')
| -rw-r--r-- | archaeological_operations/wizards.py | 15 | 
1 files changed, 6 insertions, 9 deletions
| diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 07206cc18..fffe34ca7 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -23,8 +23,7 @@ from django.conf import settings  from django.core.exceptions import ObjectDoesNotExist  from django.core.urlresolvers import reverse  from django.db.models import Max -from django.shortcuts import render_to_response -from django.template import RequestContext +from django.shortcuts import render  from django.utils.translation import ugettext_lazy as _  from ishtar_common.forms import reverse_lazy @@ -250,7 +249,7 @@ class OperationWizard(Wizard):          post_data = request.POST.copy()          # add all parcel from available in the archaeological file -        if not post_data.get('add_all_parcels'): +        if not post_data.get('add_all_parcels', None):              return super(OperationWizard, self).post(*args, **kwargs)          file = self.get_current_file() @@ -430,8 +429,7 @@ class OperationAdministrativeActWizard(OperationWizard):          self.request.session[self.current_obj_slug] = unicode(admact.pk)          self.request.session[self.get_object_name(admact)] = unicode(admact.pk) -        res = render_to_response('ishtar/wizard/wizard_done.html', dct, -                                 context_instance=RequestContext(self.request)) +        res = render(self.request, 'ishtar/wizard/wizard_done.html', dct)          return res @@ -458,9 +456,8 @@ class AdministrativeActDeletionWizard(ClosingWizard):      def done(self, form_list, **kwargs):          obj = self.get_current_object()          obj.delete() -        return render_to_response( -            'ishtar/wizard/wizard_delete_done.html', {}, -            context_instance=RequestContext(self.request)) +        return render( +            self.request, 'ishtar/wizard/wizard_delete_done.html', {})  def is_preventive(form_name, model, type_key='operation_type', key=''): @@ -506,7 +503,7 @@ def has_associated_file(form_name, file_key='associated_file', negate=False):                  'step_data'][form_name][form_name + '-' + file_key]              if type(file_id) in (list, tuple):                  file_id = file_id[0] -            file_id = int(file_id) +            int(file_id)              return not negate          except ValueError:              return negate | 
