This commit is contained in:
Sean Whalen
2018-03-27 10:22:49 -04:00
parent 02d2c12188
commit eb05aaf709
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
3.2.1
3.3.0
-----
- Fix error saving to Elasticsearch
- Fix errors when saving to Elasticsearch
3.2.0
+1 -1
View File
@@ -41,7 +41,7 @@ import imapclient.exceptions
import dateparser
import mailparser
__version__ = "3.2.1"
__version__ = "3.3.0"
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
+4 -2
View File
@@ -196,6 +196,7 @@ def save_aggregate_report_to_elasticsearch(aggregate_report):
domain = aggregate_report["policy_published"]["domain"]
begin_date = parsedmarc.human_timestamp_to_datetime(metadata["begin_date"])
end_date = parsedmarc.human_timestamp_to_datetime(metadata["end_date"])
begin_date_human = end_date.strftime("%Y-%m-%d %H:%M:%S")
end_date_human = end_date.strftime("%Y-%m-%d %H:%M:%S")
aggregate_report["begin_date"] = begin_date
aggregate_report["end_date"] = end_date
@@ -213,10 +214,11 @@ def save_aggregate_report_to_elasticsearch(aggregate_report):
existing = search.execute()
if len(existing) > 0:
raise AlreadySaved("Aggregate report from {0} about {1} with end date "
"{2} already exists in "
raise AlreadySaved("Aggregate report from {0} about {1} with date "
"range of {2} UTC to {3} UTC already exists in "
"Elasticsearch".format(org_name,
domain,
begin_date_human,
end_date_human))
published_policy = PublishedPolicy(
adkim=aggregate_report["policy_published"]["adkim"],