Skip to content

Commit

Permalink
Merge branch 'master' into ticket/lipisha-accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
gannetson authored Sep 5, 2022
2 parents bf17949 + 1a9d4dd commit b00a6b7
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 b00a6b7

Please sign in to comment.