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
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'))