From 7b0773ab6dd5af2b2dc64c8414a687c1ad932aa9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 30 May 2011 11:24:30 +0200 Subject: [PATCH] editable --- pandora/place/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/place/models.py b/pandora/place/models.py index eadd25c6..5dcc48eb 100644 --- a/pandora/place/models.py +++ b/pandora/place/models.py @@ -49,7 +49,7 @@ class Place(models.Model): return self.name 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 False @@ -60,6 +60,7 @@ class Place(models.Model): j = { 'id': self.get_id(), 'user': self.user.username, + 'editable': self.editable(user) } for key in ('created', 'modified', 'name', 'alternativeNames', 'geoname', 'countryCode',