浏览代码

Filter locations by user

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

+ 1 - 1
vrobbler/apps/locations/views.py

@@ -9,7 +9,7 @@ class GeoLocationListView(generic.ListView):
     paginate_by = 75
 
     def get_queryset(self):
-        return super().get_queryset().order_by("-created")
+        return super().get_queryset().filter(scrobble__user_id=self.request.user.id).order_by("-created")
 
     def get_context_data(self, **kwargs):
         context_data = super().get_context_data(**kwargs)