Skip to content

Commit

Permalink
Merge pull request #10774 from CenterForOpenScience/no-reports-curren…
Browse files Browse the repository at this point in the history
…t-month

[ENG-6324] Fix Admin behavior for creating monthly reports
  • Loading branch information
Johnetordoff authored Oct 15, 2024
2 parents 84cd8aa + ed3b1bc commit 09fb099
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions admin/management/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
from dateutil.parser import isoparse
from django.views.generic import TemplateView, View
from django.contrib import messages
Expand Down Expand Up @@ -120,11 +119,11 @@ def post(self, request, *args, **kwargs):
if monthly_report_date:
report_date = isoparse(monthly_report_date).date()
else:
report_date = datetime.datetime.now().date()
report_date = None

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:
Expand Down

0 comments on commit 09fb099

Please sign in to comment.