def get_subscription_by_id(subscription_id, vo='def'): """ Get a specific subscription by id. :param subscription_id: The subscription_id to select. :param vo: The VO of the user issuing command. :raises: SubscriptionNotFound if no Subscription can be found. """ sub = subscription.get_subscription_by_id(subscription_id) if sub['account'].vo != vo: raise AccessDenied('Unable to get subscription') sub['account'] = sub['account'].external if 'filter' in sub: fil = loads(sub['filter']) if 'account' in fil: fil['account'] = [ InternalAccount(acc, fromExternal=False).external for acc in fil['account'] ] if 'scope' in fil: fil['scope'] = [ InternalScope(sco, fromExternal=False).external for sco in fil['scope'] ] sub['filter'] = dumps(fil) return sub
def get_subscription_by_id(subscription_id): """ Get a specific subscription by id. :param subscription_id: The subscription_id to select. :param session: The database session in use. :raises: SubscriptionNotFound if no Subscription can be found. """ return subscription.get_subscription_by_id(subscription_id)
def get_subscription_by_id(subscription_id): """ Get a specific subscription by id. :param subscription_id: The subscription_id to select. :param session: The database session in use. :raises: SubscriptionNotFound if no Subscription can be found. """ return subscription.get_subscription_by_id(subscription_id)
def get_subscription_by_id(subscription_id, vo='def'): """ Get a specific subscription by id. :param subscription_id: The subscription_id to select. :param vo: The VO of the user issuing command. :raises: SubscriptionNotFound if no Subscription can be found. """ sub = subscription.get_subscription_by_id(subscription_id) if sub['account'].vo != vo: raise AccessDenied('Unable to get subscription') sub['account'] = sub['account'].external return sub