'Handles the redirect after connecting'

def post_connect(self, request, user, action):

    default_url = facebook_settings.FACEBOOK_LOGIN_DEFAULT_REDIRECT
    base_next_redirect = partial(next_redirect, request, default=default_url)
    if (action is CONNECT_ACTIONS.LOGIN):
        response = base_next_redirect(next_key=['login_next', 'next'])
    elif (action is CONNECT_ACTIONS.CONNECT):
        response = base_next_redirect(next_key=['connect_next', 'next'])
    elif (action is CONNECT_ACTIONS.REGISTER):
        response = base_next_redirect(next_key=['register_next', 'next'])
    return response
