Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/schemas/dmarc_report_summary_table/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ def resolve_dmarc_report_summary_table(self, info, **kwargs):
f"User: {user_id} successfully retrieved the DmarcReportSummaryTable information for all their domains."
)

if period == 'last30days':
current_month = int(datetime.today().month)
period = calendar.month_abbr[current_month]

return DmarcReportSummaryTable(
# Get Month Name
datetime.strptime(period.lower(), "%b").strftime("%B"),
Expand All @@ -129,6 +133,9 @@ def resolve_dmarc_report_summary_table(self, info, **kwargs):


def resolve_demo_dmarc_report_summary_table(self, info, **kwargs):
period = cleanse_input(kwargs.get("period"))
year = cleanse_input(kwargs.get("year"))

data_list = []
faked_data = [
{"domain": "test.gc.ca", "data": api_return_data_1},
Expand All @@ -142,6 +149,9 @@ def resolve_demo_dmarc_report_summary_table(self, info, **kwargs):
temp_dict.update({"domain": data.get("domain")})
data_list.append(temp_dict)

if period == 'last30days':
period = calendar.month_abbr(datetime.today().month())

return DmarcReportSummaryTable(
# Get Month Name
datetime.strptime(period.lower(), "%b").strftime("%B"),
Expand Down