aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/DeviceServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web/DeviceServlet.java')
-rw-r--r--src/org/traccar/web/DeviceServlet.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/web/DeviceServlet.java b/src/org/traccar/web/DeviceServlet.java
index 6b65efa8b..f091be1af 100644
--- a/src/org/traccar/web/DeviceServlet.java
+++ b/src/org/traccar/web/DeviceServlet.java
@@ -51,8 +51,9 @@ public class DeviceServlet extends BaseServlet {
private void add(HttpServletRequest req, HttpServletResponse resp) throws Exception {
Device device = JsonConverter.objectFromJson(req.getReader(), new Device());
+ long userId = getUserId(req);
Context.getDataManager().addDevice(device);
- Context.getDataManager().linkDevice(getUserId(req), device.getId());
+ Context.getDataManager().linkDevice(userId, device.getId());
Context.getPermissionsManager().refresh();
sendResponse(resp.getWriter(), JsonConverter.objectToJson(device));
}