make registration API browsable

This commit is contained in:
Mateusz Sikora 2014-11-12 03:52:06 +01:00
parent 1732b15041
commit bbc9eeee3a

View File

@ -16,6 +16,13 @@ class Register(APIView, SignupView):
permission_classes = (AllowAny,) permission_classes = (AllowAny,)
user_serializer_class = UserDetailsSerializer user_serializer_class = UserDetailsSerializer
allowed_methods = ('POST', 'OPTIONS', 'HEAD')
def get(self, *args, **kwargs):
return Response({}, status=status.HTTP_405_METHOD_NOT_ALLOWED)
def put(self, *args, **kwargs):
return Response({}, status=status.HTTP_405_METHOD_NOT_ALLOWED)
def form_valid(self, form): def form_valid(self, form):
self.user = form.save(self.request) self.user = form.save(self.request)