Allow provider_restriction to be None or "all"

Until all the data is updated to always be "all", we have to handle the
case of provider_restriction being set to None or "all" (which mean the
same thing).

The code can be tidied up once the broadcast provider_restriction is never None.
This commit is contained in:
Katie Smith
2021-05-10 14:35:18 +01:00
parent 2f9e2dbc9d
commit 3485475270
6 changed files with 37 additions and 4 deletions

View File

@@ -2321,7 +2321,7 @@ class ServiceBroadcastAccountTypeField(GovukRadiosField):
if broadcast_channel:
account_type = "live" if live else "training"
account_type += f"-{broadcast_channel}"
if allowed_broadcast_provider:
if allowed_broadcast_provider and allowed_broadcast_provider != 'all':
account_type += f"-{allowed_broadcast_provider}"
self.data = account_type