Skip to content
Snippets Groups Projects
Unverified Commit 5315785d authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #1296 from OpenTechFund/feature/974-drf-api-key

API Key to access some endpoints
parents 37ad1e01 9241f2dc
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ from rest_framework import generics, mixins, permissions
from rest_framework.response import Response
from rest_framework.exceptions import (NotFound, PermissionDenied,
ValidationError)
from rest_framework_api_key.permissions import HasAPIKey
from django_filters import rest_framework as filters
from opentech.api.pagination import StandardResultsSetPagination
......@@ -69,7 +70,7 @@ class SubmissionList(generics.ListAPIView):
queryset = ApplicationSubmission.objects.current().with_latest_update()
serializer_class = SubmissionListSerializer
permission_classes = (
permissions.IsAuthenticated, IsApplyStaffUser,
HasAPIKey | permissions.IsAuthenticated, HasAPIKey | IsApplyStaffUser,
)
filter_backends = (filters.DjangoFilterBackend,)
filter_class = SubmissionsFilter
......
......@@ -126,6 +126,7 @@ INSTALLED_APPS = [
'django_otp.plugins.otp_static',
'two_factor',
'rest_framework',
'rest_framework_api_key',
'wagtailcache',
'hijack',
......
......@@ -36,6 +36,7 @@ django-two-factor-auth==1.9.1
django-webpack-loader==0.6.0
django_select2==7.1.0
djangorestframework==3.9.2
djangorestframework-api-key==1.3.0
django==2.1.11
gunicorn==19.9.0
mailchimp3==3.0.7
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment