From a68886a8e5969ca9aed1f312a7d32846ea9600f0 Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Fri, 11 Oct 2024 11:09:41 -0400 Subject: [PATCH] make reporter default to None --- admin/management/views.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/admin/management/views.py b/admin/management/views.py index 6546c23ad03..1252c38abc0 100644 --- a/admin/management/views.py +++ b/admin/management/views.py @@ -119,19 +119,10 @@ def post(self, request, *args, **kwargs): monthly_report_date = request.POST.get('monthly_report_date', None) if monthly_report_date: report_date = isoparse(monthly_report_date).date() - else: - messages.error(request, 'Monthly Reporter can\'t be run in future or current month') - return redirect(reverse('management:commands')) - - today = datetime.date.today() - - if report_date >= today.replace(day=1): - messages.error(request, 'Monthly Reporter can\'t be run for the current or a future month.') - return redirect(reverse('management:commands')) errors = monthly_reporters_go( - report_month=report_date.month, - report_year=report_date.year + report_month=getattr(report_date, 'month', None), + report_year=getattr(report_date, 'year', None) ) if errors: