Skip to content

Commit

Permalink
Fixing bug by adding string to datetime parser
Browse files Browse the repository at this point in the history
  • Loading branch information
JCantu248 committed Jun 22, 2021
1 parent ce69477 commit fcbd1db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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.0.5-rc.2"
__version__ = "0.0.5-rc.3"
7 changes: 5 additions & 2 deletions src/tools/gophish_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,11 @@ def export_user_reports(api, assessment_id):
campaign = get_campaign_data(api, campaign_id)

for click in campaign["clicks"]:
if first_report is None or datetime(click["time"]) < first_report:
first_report = datetime(click["time"])
if (
first_report is None
or datetime.strptime(click["time"], "%Y-%m-%dT%H:%M:%S") < first_report
):
first_report = datetime.strptime(click["time"], "%Y-%m-%dT%H:%M:%S")

user_report_doc["customer"] = None
user_report_doc["assessment"] = assessment_id
Expand Down

0 comments on commit fcbd1db

Please sign in to comment.