Skip to content

Commit

Permalink
Merge pull request #70 from EBI-Metagenomics/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
atarkowska authored Aug 22, 2018
2 parents ac5b006 + 7f49583 commit ba8d614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions emgapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from django.middleware import csrf
from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.decorators.csrf import csrf_protect

from django_filters.rest_framework import DjangoFilterBackend

Expand Down Expand Up @@ -112,11 +111,10 @@ def myaccounts(self, request, pk=None):
serializer = self.get_serializer(submitter, many=True)
return Response(serializer.data)

@csrf_protect
@list_route(
methods=['get', 'post', ],
serializer_class=ena_serializers.NotifySerializer,
permission_classes=[permissions.AllowAny]
permission_classes=[permissions.IsAuthenticated, emg_perms.IsSelf]
)
def notify(self, request, pk=None):
serializer = self.get_serializer(data=request.data)
Expand All @@ -135,11 +133,10 @@ def notify(self, request, pk=None):
)
return Response(serializer.errors)

@csrf_protect
@list_route(
methods=['get', 'post', ],
serializer_class=ena_serializers.EmailSerializer,
permission_classes=[permissions.AllowAny]
permission_classes=[permissions.IsAuthenticated, emg_perms.IsSelf]
)
def sendemail(self, request, pk=None):
serializer = self.get_serializer(data=request.data)
Expand Down
2 changes: 2 additions & 0 deletions emgapi/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,6 @@ class BasePublicationGenericViewSet(viewsets.GenericViewSet):
'authors',
'doi',
'isbn',
'pubmed_id',
'published_year',
)

0 comments on commit ba8d614

Please sign in to comment.