Skip to content

Commit

Permalink
Trigger categorization only when one-liner is published
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Gyerik committed Oct 14, 2023
1 parent 444dff7 commit 64be4f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oneliners/management/commands/categorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def handle(self, *args, **options):
categorizer = categorization.OpenAiCategorizationComputer(api_key)
adapter = models.CategorizationAdapter()

oneliners = models.OneLiner.objects.filter(onelinercategory__isnull=True)
oneliners = models.OneLiner.objects.filter(onelinercategory__isnull=True, is_published=True)
if not options['all']:
pklist = options['pk']
oneliners = oneliners.filter(pk__in=pklist)
Expand Down

0 comments on commit 64be4f0

Please sign in to comment.