summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures/forms.py')
-rw-r--r--ishtar/furnitures/forms.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py
index 5abfe90f9..376287d68 100644
--- a/ishtar/furnitures/forms.py
+++ b/ishtar/furnitures/forms.py
@@ -677,9 +677,6 @@ class OperationWizard(Wizard):
towns.append((town.pk, unicode(town)))
except (ValueError, ObjectDoesNotExist):
pass
- if not data:
- # by default fill with all towns
- data['towns'] = towns
data['TOWNS'] = sorted(towns, key=lambda x:x[1])
data = data or None
form = super(OperationWizard, self).get_form(request, storage, step,
@@ -739,7 +736,8 @@ class OperationFormReference(forms.Form):
max_val = models.Operation.objects.filter(year=year).aggregate(
Max('operation_code'))["operation_code__max"]
raise forms.ValidationError(_(u"Operation code already exist for "
- "year: %d - use a value bigger than %d") % (year, max_val))
+"year: %(year)d - use a value bigger than %(last_val)d") % {'year':year,
+ 'last_val':max_val})
return cleaned_data
class SelectedTownForm(forms.Form):