move PasswordResetForm as an attribute of PasswordReset view class

This commit is contained in:
Mateusz Sikora 2014-08-19 13:24:03 +02:00
parent 5fccb820ff
commit c863cfb0e6

View File

@ -241,6 +241,7 @@ class PasswordReset(LoggedOutRESTAPIView, GenericAPIView):
"""
serializer_class = PasswordResetSerializer
password_reset_form_class = PasswordResetForm
def post(self, request):
# Create a serializer with request.DATA
@ -248,7 +249,7 @@ class PasswordReset(LoggedOutRESTAPIView, GenericAPIView):
if serializer.is_valid():
# Create PasswordResetForm with the serializer
reset_form = PasswordResetForm(data=serializer.data)
reset_form = self.password_reset_form_class(data=serializer.data)
if reset_form.is_valid():
# Sett some values to trigger the send_email method.