<commit_before>from django.http import HttpResponseForbidden


def has_affiliated_user(function=None):
    def inner(request, *args, **kwargs):
        user = request.user
        if user.is_authenticated and user.extended_profile.organization:
            return function(request, *args, **kwargs)
        return HttpResponseForbidden('Access denied!')

    return inner<commit_msg>LP-1970 OTHER Implement Marketplace Request Form (#1524)<commit_after>from django.http import HttpResponseRedirect
from django.urls import reverse


def has_affiliated_user(function=None):
    def inner(request, *args, **kwargs):
        user = request.user

        if user.is_authenticated:
            redirect_url = reverse('additional_information')
        else:
            redirect_url = "/login?next={next}".format(next=request.path)

        if user.is_authenticated and user.extended_profile.organization:
            return function(request, *args, **kwargs)
        return HttpResponseRedirect(redirect_to=redirect_url)

    return inner
{'fraction_non_alphanumeric': 0.08914728682170543, 'fraction_numerical': 0.007751937984496124, 'mean_word_length': 3.67420814479638, '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': '2389990', 'n_tokens_mistral': 288, 'n_tokens_neox': 268, 'n_words': 65}