Skip to content

Commit

Permalink
bugfix: send notice task
Browse files Browse the repository at this point in the history
  • Loading branch information
blackholll committed Feb 12, 2019
1 parent 0444e2b commit a10b9a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def send_ticket_notice(ticket_id):
return False, msg
title_result = title_template.format(**ticket_value_info)
content_result = content_template.format(**ticket_value_info)
notice_script_file = notice_obj.script
notice_script_file_name = notice_obj.script.name
notice_script_dir = os.path.join(settings.MEDIA_ROOT, "notice_script")
notice_script_file = os.path.join(notice_script_dir, notice_script_file_name)

globals = {'title_result': title_result, 'content_result': content_result, 'participant': ticket_obj.participant}
try:
Expand All @@ -245,7 +247,7 @@ def send_ticket_notice(ticket_id):
script_result = True
# script_result_msg = ''.join(s.buflist)
script_result_msg = ''.join(s.getvalue())
logger.info('send notice successful for ticket_id: {}, notice_id:{}'.formt(ticket_id, notice_id))
logger.info('send notice successful for ticket_id: {}, notice_id:{}'.format(ticket_id, notice_id))
except Exception as e:
logger.error(traceback.format_exc())
script_result = False
Expand Down

0 comments on commit a10b9a8

Please sign in to comment.