<commit_before># from ipynbsrv.core.models import BackendUser


def login_allowed(user):
    """
    @user_passes_test decorator to check whether the user is allowed to access the application or not.

    We do not want to allow non-UserBackend users to access the application
    (because we need the LDAP entry for the shares etc.) so we check that here.
    """
    return True
    # if user is None or user.get_username() is None:
    #     return False
    # return BackendUser.objects.filter(user__id=user.id).exists()<commit_msg>fix login_allowed check<commit_after># from ipynbsrv.core.models import BackendUser


def login_allowed(user):
    """
    @user_passes_test decorator to check whether the user is allowed to access the application or not.

    We do not want to allow non-UserBackend users to access the application
    (because we need the LDAP entry for the shares etc.) so we check that here.
    """
    if user is None or user.get_username() is None:
        return False
    return hasattr(user, 'backend_user')
{'fraction_non_alphanumeric': 0.06660231660231661, 'fraction_numerical': 0.0, 'mean_word_length': 3.4506437768240343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2106665', 'n_tokens_mistral': 291, 'n_tokens_neox': 288, 'n_words': 126}