Skip to content

Commit

Permalink
Fixed references to num_weeks in command
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstottmoj committed Dec 5, 2024
1 parent bd485f4 commit 124ecc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controlpanel/cli/management/commands/feedback_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def handle(self, *args, **options):
if options["all"]:
feedback_items = Feedback.objects.all()
else:
self.stdout.write(f"num_weeks: {options['num_weeks']}")
timeframe = today - timedelta(weeks=options["num_weeks"])
self.stdout.write(f"weeks: {options['weeks']}")
timeframe = today - timedelta(weeks=options["weeks"])
feedback_items = Feedback.objects.filter(date_added__gte=timeframe)

if not feedback_items:
self.stdout.write(f"No feedback found for the past {options['num_weeks']} weeks")
self.stdout.write(f"No feedback found for the past {options['weeks']} weeks")
return

filename = f"feedback_{today}.csv"
Expand Down

0 comments on commit 124ecc6

Please sign in to comment.