Skip to content

Commit

Permalink
Bug fix for concatenation with string and date objects when creating …
Browse files Browse the repository at this point in the history
…the summary file.

Using strftime() to parse a datetime object and convert to a string for concatenation purposes
  • Loading branch information
JCantu248 committed Aug 27, 2021
1 parent a0b8774 commit 8f0f2ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/gophish_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ def write_campaign_summary(api, assessment_id):
campaign_ids = get_campaign_ids(api, assessment_id)
campaign_data_template = "campaign_data.json"
campaign_summary_json = assessment_id + "_campaign_data.json"
campaign_summary_textfile = assessment_id + "_summary_" + datetime.now() + ".txt"
campaign_summary_textfile = (
assessment_id
+ "_summary_"
+ datetime.strftime((datetime.now(), "%Y-%m-%dT%H:%M:%S"))
+ ".txt"
)

logging.info("Writing campaign summary report to %s" % campaign_summary_textfile)
with open(campaign_data_template) as f:
Expand Down

0 comments on commit 8f0f2ba

Please sign in to comment.