浏览代码

[locations] Need to spoof user in gps webhook

Colin Powell 1 年之前
父节点
当前提交
13124aca6b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      vrobbler/apps/scrobbles/views.py

+ 6 - 1
vrobbler/apps/scrobbles/views.py

@@ -375,7 +375,12 @@ def gps_webhook(request):
         json_data = json.dumps(data_dict, indent=4)
         logger.debug(f"{json_data}")
 
-    scrobble = gpslogger_scrobble_location(data_dict, request.user.id)
+    # TODO Fix this so we have to authenticate!
+    user_id = 1
+    if request.user.id:
+        user_id = request.user.id
+
+    scrobble = gpslogger_scrobble_location(data_dict, user_id)
 
     if not scrobble:
         return Response({}, status=status.HTTP_200_OK)