Esempio n. 1
0
def TEST(request, user_id=None):
    # API取得
    authdevice = get_auth_device_api(request, user_id=user_id)
    # 認証済みか
    if authdevice.is_auth_device:
        Log.debug('Device authrized already. id=%s' % authdevice.auth_id)
    else:
        # 認証済みでなければチェック
        Log.debug('Checking device auth')
        is_auth_done = authdevice.check_auth_device()
        if is_auth_done:
            # 認証処理完了
            Log.debug('Device authrized now. id=%s' % authdevice.auth_id)
Esempio n. 2
0
File: test.py Progetto: subc/anchovy
def TEST(request, user_id=None):
    # API取得
    authdevice = get_auth_device_api(request, user_id=user_id)
    # 認証済みか
    if authdevice.is_auth_device:
        Log.debug('Device authrized already. id=%s' % authdevice.auth_id)
    else:
        # 認証済みでなければチェック
        Log.debug('Checking device auth')
        is_auth_done = authdevice.check_auth_device()
        if is_auth_done:
            # 認証処理完了
            Log.debug('Device authrized now. id=%s' % authdevice.auth_id)
Esempio n. 3
0
        def _wrapped_view(request, *args, **kwds):
            # API取得
            authdevice = get_auth_device_api(request)
            # 認証済みか
            if not authdevice.is_auth_device:
                if error_view_name:
                    # error_view_nameが指定されていればリダイレクトする
                    args = error_view_params if error_view_params else []
                    view = reverse(error_view_name, args=args)
                    return HttpResponseOpensocialRedirect(view)
                else:
                    # error_view_nameが指定されていなければ例外発生
                    err_mes = 'Not authorized device (UserID:%s)'
                    raise Error(err_mes % request.osuser.userid)

            return view_func(request, *args, **kwds)