From afd6a40e4093615fa256932760967eeac2612af0 Mon Sep 17 00:00:00 2001 From: irtazaakram Date: Wed, 30 Aug 2023 11:29:05 +0500 Subject: [PATCH] fix: got both positional and keyword arguments --- lms/djangoapps/bulk_email/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index 37d9a6276f4c..f6e232232a29 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -164,7 +164,8 @@ class Meta: app_label = "bulk_email" def __init__(self, *args, **kwargs): - kwargs['target_type'] = SEND_TO_COHORT + if not args: + kwargs['target_type'] = SEND_TO_COHORT super().__init__(*args, **kwargs) def __str__(self): @@ -209,7 +210,8 @@ class Meta: app_label = "bulk_email" def __init__(self, *args, **kwargs): - kwargs['target_type'] = SEND_TO_TRACK + if not args: + kwargs['target_type'] = SEND_TO_TRACK super().__init__(*args, **kwargs) def __str__(self):