

@login_required
def dashboard(request):
    "\n    Shows all members as a list - with the capacity to filter by\n    member skills and roles.\n\n    Session containing 'show_welcome' displays custom message for our\n    user's first visit.\n    "
    show_welcome = request.session.get('show_welcome')
    if (show_welcome is not None):
        del request.session['show_welcome']
    user = request.user
    listed_users = User.objects.filter(is_active=True).order_by('full_name').prefetch_related('userskill_set', 'userskill_set__skill', 'roles', 'links', 'links__icon')
    if (request.method == 'GET'):
        form = FilterMemberForm(request.GET)
        if form.is_valid():
            skills = form.cleaned_data['skills']
            roles = form.cleaned_data['roles']
            if skills:
                listed_users = listed_users.filter(skill__in=skills).distinct()
            if roles:
                listed_users = listed_users.filter(roles__in=roles).distinct()
    else:
        form = FilterMemberForm()
    context = {
        'logged_in_user': user,
        'listed_users': listed_users,
        'form': form,
        'show_welcome': show_welcome,
    }
    return render(request, 'discover/list.html', context)

dataset/ETHPy150Open nlhkabu/connect/connect/discover/views.py dashboard/original