Skip to content

Commit

Permalink
feat: Add the capability in the populate product catalog management c…
Browse files Browse the repository at this point in the history
…ommand to add multiple product sources
  • Loading branch information
AfaqShuaib09 committed Sep 26, 2024
1 parent 18d78aa commit 038269e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def add_arguments(self, parser):
dest='product_source',
type=str,
required=False,
help='The product source to filter the products'
help='The comma-separated product source str to filter the products'
)
parser.add_argument(
'--use_gspread_client',
Expand Down Expand Up @@ -86,7 +86,7 @@ def get_products(self, product_type, product_source):
queryset = queryset.filter(type__slug=CourseType.BOOTCAMP_2U)

if product_source:
queryset = queryset.filter(product_source__slug=product_source)
queryset.filter(product_source__slug__in=product_source.split(','))

queryset = queryset.annotate(
num_orgs=Count('authoring_organizations')
Expand All @@ -109,7 +109,7 @@ def get_products(self, product_type, product_source):
.select_related('partner', 'type', 'primary_subject_override', 'language_override')

if product_source:
queryset = queryset.filter(product_source__slug=product_source)
queryset.filter(product_source__slug__in=product_source.split(','))

queryset = queryset.annotate(
num_orgs=Count('authoring_organizations')
Expand Down

0 comments on commit 038269e

Please sign in to comment.