Skip to content

Commit

Permalink
Merge c758365 into 51ab028
Browse files Browse the repository at this point in the history
  • Loading branch information
JCantu248 committed Nov 10, 2021
2 parents 51ab028 + c758365 commit 3c22042
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""This file defines the version of this project."""
__version__ = "0.1.0"
__version__ = "0.1.1"
19 changes: 16 additions & 3 deletions src/assessment/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Standard Python Libraries
import copy
import csv
from datetime import datetime
import json
import logging
import sys
Expand Down Expand Up @@ -153,17 +154,29 @@ def build_campaigns(assessment, campaign_number, template_smtp):
# Set up component holders
logging.info("Building Campaign %s", assessment.id)
campaign = Campaign(name=assessment.id)
campaign_tz = pytz.timezone(assessment.timezone)

# Get Launch Time
campaign.launch_date = get_time_input("start", assessment.timezone)
while True:
campaign.launch_date = get_time_input("start", assessment.timezone)

if campaign.launch_date > datetime.now(campaign_tz).isoformat():
break
else:
logging.error("Launch date is not after the current datetime")

while True:
campaign.complete_date = get_time_input("end", assessment.timezone)

if campaign.complete_date > campaign.launch_date:
break
pass # Do nothing yet and continue checks
else:
logging.error("Complete date is not after launch date.")

if campaign.complete_date > datetime.now(campaign_tz).isoformat():
break # Valid input, break out of loop
else:
logging.error("Complete Date is not after Launch Date.")
logging.error("Complete date is not after the current datetime.")

campaign.smtp, campaign.template = import_email(
assessment, campaign_number, template_smtp
Expand Down

0 comments on commit 3c22042

Please sign in to comment.