if not is_admin_context(context):
volume = models.Volume
- query = query.options(joinedload('volume')).\
- filter(volume.project_id == context.project_id)
+ query = query.filter(models.Transfer.volume_id == volume.id,
+ volume.project_id == context.project_id)
result = query.first()
def transfer_get_all_by_project(context, project_id):
authorize_project_context(context, project_id)
- volume = models.Volume
query = model_query(context, models.Transfer).\
- options(joinedload('volume')).\
- filter(volume.project_id == project_id)
+ filter(models.Volume.id == models.Transfer.volume_id,
+ models.Volume.project_id == project_id)
results = query.all()
return _translate_transfers(results)
nctxt = context.RequestContext(user_id='new_user_id',
project_id='new_project_id')
+ utils.create_volume(nctxt, id='2', updated_at=self.updated_at)
self.assertRaises(exception.TransferNotFound,
tx_api.get,
nctxt,