From 6c4a2a029ccf38503e756e181af7c0efd0e768f0 Mon Sep 17 00:00:00 2001 From: rhaeyx <43877303+rhaeyx@users.noreply.github.com> Date: Mon, 4 Nov 2024 05:25:15 +0800 Subject: [PATCH] Add missing docstrings for registration views (#619) * Add missing docstrings for registration views The missing docstrings are annoying when using autogenerated schemas with swagger or similar api documentation tools * Appease flake8 requirement --- dj_rest_auth/registration/views.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dj_rest_auth/registration/views.py b/dj_rest_auth/registration/views.py index 8079a111..6b6a65b3 100644 --- a/dj_rest_auth/registration/views.py +++ b/dj_rest_auth/registration/views.py @@ -32,6 +32,11 @@ class RegisterView(CreateAPIView): + """ + Registers a new user. + + Accepts the following POST parameters: username, email, password1, password2. + """ serializer_class = api_settings.REGISTER_SERIALIZER permission_classes = api_settings.REGISTER_PERMISSION_CLASSES token_model = TokenModel @@ -94,6 +99,11 @@ def perform_create(self, serializer): class VerifyEmailView(APIView, ConfirmEmailView): + """ + Verifies the email associated with the provided key. + + Accepts the following POST parameter: key. + """ permission_classes = (AllowAny,) allowed_methods = ('POST', 'OPTIONS', 'HEAD') @@ -113,6 +123,11 @@ def post(self, request, *args, **kwargs): class ResendEmailVerificationView(CreateAPIView): + """ + Resends another email to an unverified email. + + Accepts the following POST parameter: email. + """ permission_classes = (AllowAny,) serializer_class = ResendEmailVerificationSerializer queryset = EmailAddress.objects.all()