Created
May 26, 2016 16:26
-
-
Save tonytan4ever/aa8059a5304cade7097a0a2a2b368699 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import optparse | |
from django.conf import settings | |
from django.core.mail import EmailMultiAlternatives | |
from dashboardv2.views.reports_home import REPORT_TYPES | |
from utils.management.base import LoggingCommand | |
from utils.misc import send_email_with_retry | |
SUBJECT = 'Huron reports' | |
SENDER = 'Huron no-reply <%s>' % settings.EMAIL_HOST_USER | |
#RECIPIENTS = settings.HN_HURON_STATUS_RECIPIENTS | |
class Command(LoggingCommand): | |
help = 'Send reports to user via email' | |
option_list = LoggingCommand.option_list + ( | |
optparse.make_option( | |
'-t', '--report_type', | |
dest='report_type to send to user', | |
action='store', | |
default="census", type='string', | |
help='What kind of report to send to user'), | |
optparse.make_option( | |
'-u', '--user_name', | |
dest='user_name', | |
action='store', type='string', default='all', | |
help=('Which specific user to send report to'), | |
) | |
) | |
def do_work(self, *args, **options): | |
self.logger.info('=== send_reports_via_email ===') | |
#vals = REPORT_TYPES[c['rtype']]['func'](request.session['hse_zone'],[start_day,end_day]) | |
#path_name = _build_excel(c['rtype'],request.user.username,[start_day,end_day],vals) | |
print "Hello World" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment