From 67b2fd698b879aadda652b8b33e87fde51310bcb Mon Sep 17 00:00:00 2001 From: j Date: Sat, 25 Feb 2017 11:18:59 +0100 Subject: [PATCH] fix save place --- pandora/annotation/views.py | 2 +- pandora/place/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index 09e3ecb6..b8345d6b 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -314,7 +314,7 @@ def editAnnotation(request, data): setattr(a, { 'in': 'start', 'out': 'end' - }.get(key,key), value) + }.get(key, key), value) add_changelog(request, data) a.save() #update sort/find tables async diff --git a/pandora/place/models.py b/pandora/place/models.py index 022778db..9eb66fc5 100644 --- a/pandora/place/models.py +++ b/pandora/place/models.py @@ -151,7 +151,7 @@ class Place(models.Model): self.geoname_sort = ', '.join(reversed(self.geoname.split(', '))) self.name_find = '|%s|' % '|'.join([self.name]+list(self.alternativeNames)).lower() - self.defined = len(filter(None, [getattr(self, key) - for key in ('south', 'west', 'north', 'east')])) > 0 + self.defined = len(list(filter(None, [getattr(self, key) + for key in ('south', 'west', 'north', 'east')]))) > 0 super(Place, self).save(*args, **kwargs)