Commit 88e3292b authored by Hypsug0's avatar Hypsug0
Browse files

little fix

parent 344e2461
......@@ -107,7 +107,7 @@ class MetaPlace(gismodels.Model):
def save(self, *args, **kwargs):
# Regenerate autogeom if checked after update
id_metaplace = self.id_metaplace
if id_metaplace != None:
if id_metaplace is not None:
places = Place.objects.filter(metaplace_id=id_metaplace)
logger.debug("places {} : {}".format(len(places), places))
if self.autogeom:
......@@ -302,11 +302,13 @@ class Place(models.Model):
self.x = self.geom.y
try:
self.territory = Territory.objects.get(geom__contains=self.geom)
except:
except Exception as e:
logger.debug(str(e))
pass
try:
self.municipality = Municipality.objects.get(geom__contains=self.geom)
except:
except Exception as e:
logger.debug(str(e))
pass
# self.creator = current_user()
super(Place, self).save(*args, **kwargs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment