@receiver(send_admin_notification, sender=CourseCreator)
def send_admin_notification_callback(sender, **kwargs):
 user = kwargs['user']
 studio_request_email = settings.FEATURES.get('STUDIO_REQUEST_EMAIL', '')
 context = {'user_name': user.username, 'user_email': user.email}
 subject = render_to_string('emails/course_creator_admin_subject.txt', context)
 subject = ''.join(subject.splitlines())
 message = render_to_string('emails/course_creator_admin_user_pending.txt', context)
 try:
  send_mail(subject, message, studio_request_email, [studio_request_email], fail_silently=False)
 except SMTPException:
  log.warning("Failure sending 'pending state' e-mail for %s to %s", user.email, studio_request_email)

@ receiver ( send_admin_notification , sender = CourseCreator ) def send_admin_notification_callback ( sender , ** kwargs ) : user = kwargs [ 'user' ] studio_request_email = settings . FEATURES . get ( 'STUDIO_REQUEST_EMAIL' , '' ) context = { 'user_name' : user . username , 'user_email' : user . email } subject = render_to_string ( 'emails/course_creator_admin_subject.txt' , context ) subject = '' . join ( subject . splitlines ( ) ) message = render_to_string ( 'emails/course_creator_admin_user_pending.txt' , context ) try : send_mail ( subject , message , studio_request_email , [ studio_request_email ] , fail_silently = False ) except SMTPException : log . warning ( "Failure sending 'pending state' e-mail for %s to %s" , user . email , studio_request_email )
callback for notifying admin of a user in the pending state .