コード例 #1
0
ファイル: views.py プロジェクト: terroni/osf.io
    def get_object(self):
        user_settings = self.get_addon_settings()
        account_id = self.kwargs['account_id']

        account = ExternalAccount.load(account_id)
        if not (account and account in user_settings.external_accounts):
            raise NotFound('Requested addon unavailable')
        return account
コード例 #2
0
    def get_object(self):
        user_settings = self.get_addon_settings()
        account_id = self.kwargs['account_id']

        account = ExternalAccount.load(account_id)
        if not (account and account in user_settings.external_accounts):
            raise NotFound('Requested addon unavailable')
        return account
コード例 #3
0
    def get_object(self):
        user_settings = self.get_addon_settings(check_object_permissions=False)
        account_id = self.kwargs['account_id']

        account = ExternalAccount.load(account_id)
        if not (account and user_settings.external_accounts.filter(id=account.id).exists()):
            raise NotFound('Requested addon unavailable')
        return account