Enhance DropCampaign handling: default is_enabled to True if missing, add url field to ChannelInfoSchema
This commit is contained in:
parent
4562991ad2
commit
0751c6cd0b
5 changed files with 131 additions and 28 deletions
|
|
@ -793,8 +793,10 @@ class Command(BaseCommand):
|
|||
allow_schema: The DropCampaignACL Pydantic schema.
|
||||
"""
|
||||
# Update the allow_is_enabled flag if changed
|
||||
if campaign_obj.allow_is_enabled != allow_schema.is_enabled:
|
||||
campaign_obj.allow_is_enabled = allow_schema.is_enabled
|
||||
# Default to True if is_enabled is None (API doesn't always provide this field)
|
||||
is_enabled: bool = allow_schema.is_enabled if allow_schema.is_enabled is not None else True
|
||||
if campaign_obj.allow_is_enabled != is_enabled:
|
||||
campaign_obj.allow_is_enabled = is_enabled
|
||||
campaign_obj.save(update_fields=["allow_is_enabled"])
|
||||
|
||||
# Get or create all channels and collect them
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue