def METHOD_NAME(request):
    if not hasattr(request, '_cached_user'):
        create_user = check_current_request(request)
        user = auth.METHOD_NAME(request)
        # Set the flag in the session
        if not request.session.get('has_demo_data'):
            request.session['has_demo_data'] = False
        # Django didn't find a user, so create one now
        if settings.WGER_SETTINGS['ALLOW_GUEST_USERS'] and \
            request.method == 'GET' and \
            create_user and not user.is_authenticated:
            logger.debug('creating a new guest user now')
            user = create_temporary_user(request)
            django_login(request, user)
        request._cached_user = user
    return request._cached_user