New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update feature to send emails to evalai users using amazon ses #1624
Conversation
8248333
to
6b3fb79
Compare
apps/web/views.py
Outdated
'notification_email_conformation.html', | ||
{'message': 'All the emails are sent successfully!'}) | ||
except: | ||
return render(request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever there is an exception, try to log it with proper severity level.
apps/web/views.py
Outdated
else: | ||
return render(request, 'error404.html') | ||
else: | ||
return render(request, 'error404.html') | ||
return render(request, 'error_superuser.html') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return 404. No need to show exactly what happened.
apps/web/views.py
Outdated
template_name = 'notification_email.html' | ||
emails = User.objects.all().exclude(email__isnull=True, email__exact='').values_list('email', flat=True) | ||
htmly = get_template('notification_email.html') | ||
users = list(User.objects.exclude(email__exact='').values_list('email', flat=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to convert to list? Doesn't values_list
takes care of that? I am not sure about this though. Please add a comment on the line why we are converting to list if we need to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, for now we don't need that. Earlier boto
required it to be converted to a list rather than Queryset
object. :-)
@deshraj Please review the PR.
Fixes #1549