mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-07-03 23:44:17 +00:00
3.3.0
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
3.2.1
|
||||
3.3.0
|
||||
-----
|
||||
- Fix error saving to Elasticsearch
|
||||
- Fix errors when saving to Elasticsearch
|
||||
|
||||
|
||||
3.2.0
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user