diff options
Diffstat (limited to 'chimere/forms.py')
-rw-r--r-- | chimere/forms.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chimere/forms.py b/chimere/forms.py index 6a7d7aa..49f714f 100644 --- a/chimere/forms.py +++ b/chimere/forms.py @@ -478,6 +478,8 @@ class AreaAdminForm(forms.ModelForm): raise forms.ValidationError(msg) if self.cleaned_data.get('order'): q = Area.objects.filter(order=self.cleaned_data.get('order')) + if self.instance: + q = q.exclude(pk=self.instance.pk) if q.count(): msg= _(u"The area \"%s\" has the same order, you need to " u" choose another one.") % unicode(q.all()[0]) |