Skip to content

Commit fcb74ce

Browse files
authored
just set month to current month (canada-ca#786)
1 parent 3c043f2 commit fcb74ce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

api/schemas/dmarc_report_summary_table/resolver.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ def resolve_dmarc_report_summary_table(self, info, **kwargs):
119119
f"User: {user_id} successfully retrieved the DmarcReportSummaryTable information for all their domains."
120120
)
121121

122+
if period == 'last30days':
123+
current_month = int(datetime.today().month)
124+
period = calendar.month_abbr[current_month]
125+
122126
return DmarcReportSummaryTable(
123127
# Get Month Name
124128
datetime.strptime(period.lower(), "%b").strftime("%B"),
@@ -129,6 +133,9 @@ def resolve_dmarc_report_summary_table(self, info, **kwargs):
129133

130134

131135
def resolve_demo_dmarc_report_summary_table(self, info, **kwargs):
136+
period = cleanse_input(kwargs.get("period"))
137+
year = cleanse_input(kwargs.get("year"))
138+
132139
data_list = []
133140
faked_data = [
134141
{"domain": "test.gc.ca", "data": api_return_data_1},
@@ -142,6 +149,9 @@ def resolve_demo_dmarc_report_summary_table(self, info, **kwargs):
142149
temp_dict.update({"domain": data.get("domain")})
143150
data_list.append(temp_dict)
144151

152+
if period == 'last30days':
153+
period = calendar.month_abbr(datetime.today().month())
154+
145155
return DmarcReportSummaryTable(
146156
# Get Month Name
147157
datetime.strptime(period.lower(), "%b").strftime("%B"),

0 commit comments

Comments
 (0)