Skip to content

Commit

Permalink
Merge d5b3bfe into 180f170
Browse files Browse the repository at this point in the history
  • Loading branch information
gannetson committed Aug 31, 2022
2 parents 180f170 + d5b3bfe commit 4a46970
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bluebottle/impact/urls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
from bluebottle.impact.views import (
ImpactTypeList,
ImpactGoalList,
ImpactGoalDetail
ImpactGoalDetail, ImpactTypeDetail
)

urlpatterns = [
url(r'^types$', ImpactTypeList.as_view(), name='impact-type-list'),
url(
r'^types/(?P<pk>\d+)$',
ImpactTypeDetail.as_view(),
name='impact-details'
),
url(r'^goals$', ImpactGoalList.as_view(), name='impact-goal-list'),
url(
r'^goals/(?P<pk>\d+)$',
Expand Down
11 changes: 10 additions & 1 deletion bluebottle/impact/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
JsonApiViewMixin,
ListAPIView,
CreateAPIView,
RetrieveUpdateDestroyAPIView
RetrieveUpdateDestroyAPIView, RetrieveAPIView
)
from bluebottle.utils.permissions import TenantConditionalOpenClose

Expand All @@ -33,6 +33,15 @@ class ImpactTypeList(JsonApiViewMixin, ListAPIView):
filter_backends = (ImpactTypeSearchFilter, )


class ImpactTypeDetail(JsonApiViewMixin, RetrieveAPIView):
queryset = ImpactType.objects.filter(active=True)

permission_classes = [TenantConditionalOpenClose, ]
serializer_class = ImpactTypeSerializer
pagination_class = ImpactTypePagination
filter_backends = (ImpactTypeSearchFilter, )


class ImpactGoalList(JsonApiViewMixin, CreateAPIView):
queryset = ImpactGoal.objects.filter()

Expand Down

0 comments on commit 4a46970

Please sign in to comment.