示例#1
0
def can_delete(article, user):
    return not user.is_anonymous() and settings.CAN_DELETE(article, user)
示例#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)
示例#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)