black icons, edit places
This commit is contained in:
parent
876e360e76
commit
d5a3231704
2 changed files with 9 additions and 4 deletions
|
@ -678,7 +678,6 @@ def poster(request, id, size=None):
|
||||||
response['Cache-Control'] = 'no-cache'
|
response['Cache-Control'] = 'no-cache'
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
def icon(request, id, size=None):
|
def icon(request, id, size=None):
|
||||||
item = get_object_or_404(models.Item, itemId=id)
|
item = get_object_or_404(models.Item, itemId=id)
|
||||||
if not item.access(request.user):
|
if not item.access(request.user):
|
||||||
|
@ -686,8 +685,10 @@ def icon(request, id, size=None):
|
||||||
if item.icon:
|
if item.icon:
|
||||||
return image_to_response(item.icon, size)
|
return image_to_response(item.icon, size)
|
||||||
else:
|
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):
|
def timeline(request, id, size, position):
|
||||||
item = get_object_or_404(models.Item, itemId=id)
|
item = get_object_or_404(models.Item, itemId=id)
|
||||||
|
|
|
@ -56,7 +56,11 @@ class Place(models.Model):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def editable(self, user):
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue