Revision 0069a20c snf-cyclades-app/synnefo/api/util.py

b/snf-cyclades-app/synnefo/api/util.py
235 235
        if for_update:
236 236
            objects = objects.select_for_update()
237 237

  
238
        port = objects.get(network__userid=user_id, id=port_id)
238
        if not user_id:
239
            port = objects.get(id=port_id)
240
        else:
241
            port = objects.get(network__userid=user_id, id=port_id)
239 242

  
240 243
        if (port.device_owner != "vm") and for_update:
241 244
            raise faults.BadRequest('Can not update non vm port')

Also available in: Unified diff