mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-06-29 17:13:03 +03:00
Flake8 issues solved
This commit is contained in:
parent
aab8bf4740
commit
ea1150b421
|
@ -216,5 +216,6 @@ class RegisterSerializer(serializers.Serializer):
|
||||||
class VerifyEmailSerializer(serializers.Serializer):
|
class VerifyEmailSerializer(serializers.Serializer):
|
||||||
key = serializers.CharField()
|
key = serializers.CharField()
|
||||||
|
|
||||||
|
|
||||||
class ResendVerificationEmailSerializer(serializers.Serializer):
|
class ResendVerificationEmailSerializer(serializers.Serializer):
|
||||||
email = serializers.EmailField()
|
email = serializers.EmailField()
|
||||||
|
|
|
@ -104,7 +104,7 @@ class ResendVerificationEmailView(GenericAPIView):
|
||||||
serializer_class = ResendVerificationEmailSerializer
|
serializer_class = ResendVerificationEmailSerializer
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
allowed_methods = ('POST', 'OPTIONS', 'HEAD')
|
allowed_methods = ('POST', 'OPTIONS', 'HEAD')
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
serializer = self.get_serializer(data=request.data)
|
serializer = self.get_serializer(data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
|
@ -118,6 +118,7 @@ class ResendVerificationEmailView(GenericAPIView):
|
||||||
|
|
||||||
return Response({'detail': _('Verification e-mail sent.')})
|
return Response({'detail': _('Verification e-mail sent.')})
|
||||||
|
|
||||||
|
|
||||||
class SocialLoginView(LoginView):
|
class SocialLoginView(LoginView):
|
||||||
"""
|
"""
|
||||||
class used for social authentications
|
class used for social authentications
|
||||||
|
|
|
@ -520,8 +520,8 @@ class APIBasicTests(TestsMixin, TestCase):
|
||||||
self.get(self.logout_url, status_code=status.HTTP_405_METHOD_NOT_ALLOWED)
|
self.get(self.logout_url, status_code=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||||
|
|
||||||
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
||||||
def test_resend_account_verification_email(self):
|
def test_resend_account_verification_email(self):
|
||||||
result = self.post(
|
self.post(
|
||||||
self.register_url,
|
self.register_url,
|
||||||
data=self.REGISTRATION_DATA_WITH_EMAIL,
|
data=self.REGISTRATION_DATA_WITH_EMAIL,
|
||||||
status_code=status.HTTP_201_CREATED
|
status_code=status.HTTP_201_CREATED
|
||||||
|
@ -544,7 +544,7 @@ class APIBasicTests(TestsMixin, TestCase):
|
||||||
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
||||||
def test_resend_not_registered_account_verification_email(self):
|
def test_resend_not_registered_account_verification_email(self):
|
||||||
self.assertEqual(EmailAddress.objects.count(), 0)
|
self.assertEqual(EmailAddress.objects.count(), 0)
|
||||||
|
|
||||||
self.post(
|
self.post(
|
||||||
reverse('rest_resend_verification_email'),
|
reverse('rest_resend_verification_email'),
|
||||||
data={
|
data={
|
||||||
|
@ -557,7 +557,7 @@ class APIBasicTests(TestsMixin, TestCase):
|
||||||
|
|
||||||
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
@override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory')
|
||||||
def test_resend_already_verified_account_verification_email(self):
|
def test_resend_already_verified_account_verification_email(self):
|
||||||
result = self.post(
|
self.post(
|
||||||
self.register_url,
|
self.register_url,
|
||||||
data=self.REGISTRATION_DATA_WITH_EMAIL,
|
data=self.REGISTRATION_DATA_WITH_EMAIL,
|
||||||
status_code=status.HTTP_201_CREATED
|
status_code=status.HTTP_201_CREATED
|
||||||
|
|
Loading…
Reference in New Issue
Block a user