示例#1
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
示例#2
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
示例#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
def get_targets():
    return ExternalAccount.find(Q("provider", "eq", "zotero") | Q("provider", "eq", "mendeley"))
def get_targets():
    return ExternalAccount.find(
        Q('provider', 'eq', 'zotero') | Q('provider', 'eq', 'mendeley'))
def get_targets():
    return ExternalAccount.find(Q('provider', 'eq', 'zotero') | Q('provider', 'eq', 'mendeley'))