Commit e8f109a3 by attiyaishaque

Revert "ECOM-5281 Add retires for email sending while registering."

This reverts commit 4bbeaf32.
parent 648bc7ef
......@@ -335,6 +335,3 @@ INSTALLED_APPS += ('openedx.core.djangoapps.api_admin',)
# Set the default Oauth2 Provider Model so that migrations can run in
# verbose mode
OAUTH2_PROVIDER_APPLICATION_MODEL = 'oauth2_provider.Application'
# Used with Email sending
RETRY_ACTIVATION_EMAIL_MAX_ATTEMPTS = 5
......@@ -1791,8 +1791,6 @@ def create_account_with_params(request, params):
'email_from_address',
settings.DEFAULT_FROM_EMAIL
)
retries = settings.RETRY_ACTIVATION_EMAIL_MAX_ATTEMPTS
while retries:
try:
if settings.FEATURES.get('REROUTE_ACTIVATION_EMAIL'):
dest_addr = settings.FEATURES['REROUTE_ACTIVATION_EMAIL']
......@@ -1801,22 +1799,13 @@ def create_account_with_params(request, params):
mail.send_mail(subject, message, from_address, [dest_addr], fail_silently=False)
else:
user.email_user(subject, message, from_address)
# Log that the Activation Email has been sent to user without an exception
log.info("Activataion Email has been sent to User {user_email}".format(
user_email=dest_addr
))
break
except Exception: # pylint: disable=broad-except
retries -= 1
if retries <= 0:
break
log.error(
u'Unable to send activation email to user from "%s" to "%s"',
from_address,
dest_addr,
exc_info=True
)
else:
registration.activate()
_enroll_user_in_pending_courses(user) # Enroll student in any pending courses
......
......@@ -370,9 +370,6 @@ GENERATE_PROFILE_SCORES = False
# Used with XQueue
XQUEUE_WAITTIME_BETWEEN_REQUESTS = 5 # seconds
# Used with Email sending
RETRY_ACTIVATION_EMAIL_MAX_ATTEMPTS = 5
############################# SET PATH INFORMATION #############################
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/lms
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment