Add comment to project retrieve filter

remotes/origin/release/3.1.1
Alex Hermida 2018-01-19 13:06:14 +01:00 committed by Álex Hermida
parent 91f4d395f5
commit f7f3cc806b
1 changed files with 2 additions and 0 deletions

View File

@ -139,6 +139,8 @@ class ProjectViewSet(LikedResourceMixin, HistoryResourceMixin,
qs = self.get_queryset()
if self.action == "by_slug":
self.lookup_field = "slug"
# If we retrieve the project by slug we want to filter by user the
# permissions and return 404 in case the user don't have access
flt = filters.get_filter_expression_can_view_projects(
self.request.user)