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 c6998c8..be68205 100644 --- a/chimere/forms.py +++ b/chimere/forms.py @@ -544,6 +544,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]) |
