Skip to content

Instantly share code, notes, and snippets.

@avelino
Created April 2, 2014 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avelino/9927825 to your computer and use it in GitHub Desktop.
Save avelino/9927825 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from ..generate import image_url as url
register = template.Library()
@register.simple_tag
def all_images_check_permission(obj, user):
check_published = True
if user.is_staff or user.is_superuser:
check_published = False
return obj.all_images(check_published)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment