Beispiel #1
0
def can_delete(article, user):
    return not user.is_anonymous() and settings.CAN_DELETE(article, user)
Beispiel #2
0
def can_delete(article, user):
    if callable(settings.CAN_DELETE):
        return settings.CAN_DELETE(article, user)
    return not user.is_anonymous() and article.can_write(user)
Beispiel #3
0
def can_delete(article, user):
    if isinstance(settings.CAN_DELETE, collections.Callable):
        return settings.CAN_DELETE(article, user)
    return not user.is_anonymous() and article.can_write(user)