This commit is contained in:
j 2011-05-30 11:24:30 +02:00
parent 6aaa88d3bc
commit 7b0773ab6d

View file

@ -49,7 +49,7 @@ class Place(models.Model):
return self.name return self.name
def editable(self, user): def editable(self, user):
if user.is_staff or self.user == user: if user and user.is_staff or self.user == user:
return True return True
return False return False
@ -60,6 +60,7 @@ class Place(models.Model):
j = { j = {
'id': self.get_id(), 'id': self.get_id(),
'user': self.user.username, 'user': self.user.username,
'editable': self.editable(user)
} }
for key in ('created', 'modified', for key in ('created', 'modified',
'name', 'alternativeNames', 'geoname', 'countryCode', 'name', 'alternativeNames', 'geoname', 'countryCode',