Skip to content

Commit

Permalink
file object detail was protected, and now filelistview is also filter…
Browse files Browse the repository at this point in the history
…ed out
  • Loading branch information
Kenan7 committed Feb 9, 2021
1 parent 82682a6 commit 6b81ee9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions my_awesome_project/fileapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class FileListView(LoginRequiredMixin, ListView):
model = FileModel
template_name = "pages/home.html"

def get_queryset(self):
current_user = User.objects.get(id=self.request.user.id)
return FileModel.objects.filter(owner=current_user)


file_list_view = FileListView.as_view()

Expand Down

0 comments on commit 6b81ee9

Please sign in to comment.