Created
April 2, 2014 04:14
-
-
Save avelino/9927825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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