summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-21 15:55:13 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-21 15:57:28 +0100
commit55abbe1850efff95efe9935873b666e5fc4bf0e9 (patch)
tree5d577d5b181506be155252525db762bb922bf216 /synapse/handlers/device.py
parentMerge pull request #943 from matrix-org/rav/get_device_api (diff)
downloadsynapse-55abbe1850efff95efe9935873b666e5fc4bf0e9.tar.xz
make /devices return a list
Turns out I specced this to return a list of devices rather than a dict of them
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 110f5fbb5c..1f9e15c33c 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -79,17 +79,17 @@ class DeviceHandler(BaseHandler):
         Args:
             user_id (str):
         Returns:
-            defer.Deferred: dict[str, dict[str, X]]: map from device_id to
-            info on the device
+            defer.Deferred: list[dict[str, X]]: info on each device
         """
 
-        devices = yield self.store.get_devices_by_user(user_id)
+        device_map = yield self.store.get_devices_by_user(user_id)
 
         ips = yield self.store.get_last_client_ip_by_device(
-            devices=((user_id, device_id) for device_id in devices.keys())
+            devices=((user_id, device_id) for device_id in device_map.keys())
         )
 
-        for device in devices.values():
+        devices = device_map.values()
+        for device in devices:
             _update_device_from_client_ips(device, ips)
 
         defer.returnValue(devices)