Skip to content

Commit cf05856

Browse files
committed
Registration: Do not send confirmation email if disabled (fixes #1)
1 parent ffd8405 commit cf05856

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rest_authtoken/serializers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ def create(self, validated_data):
5555
instance.set_password(password)
5656
instance.save()
5757

58-
try:
59-
send_confirmation_email(instance)
60-
except SMTPException:
61-
raise ValidationError('failed to send confirmation email')
58+
if REGISTRATION_EMAIL_CONFIRM:
59+
try:
60+
send_confirmation_email(instance)
61+
except SMTPException:
62+
raise ValidationError('failed to send confirmation email')
6263

6364
return instance

0 commit comments

Comments
 (0)