add has_no_effect check to changes and replace undo button icon

This commit is contained in:
Laura Klünder 2017-06-25 16:12:57 +02:00
parent 1d479c4eba
commit 79220c39f9
4 changed files with 12 additions and 2 deletions

View file

@ -49,7 +49,9 @@ class GeometryField(models.TextField):
return clean_geometry(shape(json.loads(value)))
def get_prep_value(self, value):
if self.geomtype == 'polygon' and not isinstance(value, Polygon):
if value == '':
return None
elif self.geomtype == 'polygon' and not isinstance(value, Polygon):
raise TypeError(_('Expected Polygon instance, got %s instead.') % repr(value))
elif self.geomtype == 'linestring' and not isinstance(value, LineString):
raise TypeError(_('Expected LineString instance, got %s instead.') % repr(value))