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