Permalink
Browse files

Check in cleaned data no self.data for all values

  • Loading branch information...
1 parent a42bac2 commit 72dfccd767c0b99b232712b99cd3c7d534eb9917 @ortsed ortsed committed Apr 18, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 cropduster/views.py
View
@@ -55,11 +55,12 @@ class Meta:
"image": TextInput(),
}
def clean(self):
- if "crop_x" not in self.data or "crop_y" not in self.data:
+
+ cleaned_data = super(CropForm, self).clean()
+
+ if "crop_x" not in cleaned_data or "crop_y" not in cleaned_data:
self._errors.clear()
raise ValidationError("Missing crop values")
-
- cleaned_data = super(CropForm, self).clean()
if cleaned_data["crop_x"] < 0 or cleaned_data["crop_y"] < 0:
self._errors.clear()

0 comments on commit 72dfccd

Please sign in to comment.