diff --git a/pandora/item/views.py b/pandora/item/views.py index 977b319e6..3455b9af1 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -678,7 +678,6 @@ def poster(request, id, size=None): response['Cache-Control'] = 'no-cache' return response - def icon(request, id, size=None): item = get_object_or_404(models.Item, itemId=id) if not item.access(request.user): @@ -686,8 +685,10 @@ def icon(request, id, size=None): if item.icon: return image_to_response(item.icon, size) else: - raise Http404 - + poster_path = os.path.join(settings.STATIC_ROOT, 'jpg/poster.jpg') + response = HttpFileResponse(poster_path, content_type='image/jpeg') + response['Cache-Control'] = 'no-cache' + return response def timeline(request, id, size, position): item = get_object_or_404(models.Item, itemId=id) diff --git a/pandora/place/models.py b/pandora/place/models.py index 529900c8a..57c7beaad 100644 --- a/pandora/place/models.py +++ b/pandora/place/models.py @@ -56,7 +56,11 @@ class Place(models.Model): return self.name def editable(self, user): - if user and user.is_staff or self.user == user: + if not user or user.is_anonymous(): + level = 'guest' + else: + level = user.get_profile().get_level() + if self.user == user or level in ('admin', 'staff'): return True return False