def send_user_export_to_admins(u):
 body = json.dumps(generate_user_export(u), default=encode_datetime)
 msg = django.core.mail.EmailMessage(subject=('User export for %d' % u.id), body=body, to=[email for (name, email) in django.conf.settings.ADMINS])
 msg.send()

def send_user_export_to_admins ( u ) : body = json . dumps ( generate_user_export ( u ) , default = encode_datetime ) msg = django . core . mail . EmailMessage ( subject = ( 'User export for %d' % u . id ) , body = body , to = [ email for ( name , email ) in django . conf . settings . ADMINS ] ) msg . send ( )
you might want to call this function before deleting a user .