def can_moderate(article, user): return not user.is_anonymous() and settings.CAN_MODERATE(article, user)
def can_moderate(article, user): if callable(settings.CAN_MODERATE): return settings.CAN_MODERATE(article, user) return not user.is_anonymous() and user.has_perm('wiki.moderate')
def can_moderate(article, user): if isinstance(settings.CAN_MODERATE, collections.Callable): return settings.CAN_MODERATE(article, user) return not user.is_anonymous() and user.has_perm('wiki.moderate')