Simplify network choice form to use boolean radio

This follows the same pattern as in other forms [1].

[1]: 1b459d6692/app/templates/views/organisations/add-gp-organisation.html (L20)
This commit is contained in:
Ben Thorner
2021-06-07 16:52:36 +01:00
parent 5ce76b8b33
commit ef8cab7fa4
4 changed files with 28 additions and 38 deletions

View File

@@ -353,23 +353,21 @@ def service_set_broadcast_channel(service_id):
def service_set_broadcast_network(service_id, broadcast_channel):
# only populate old settings when the channel is unchanged
if current_service.broadcast_channel == broadcast_channel:
if current_service.allowed_broadcast_provider == 'all':
provider = current_service.allowed_broadcast_provider
if provider == 'all':
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel,
network_variant=(
current_service.live,
current_service.broadcast_channel,
current_service.allowed_broadcast_provider,
),
all_networks=True,
)
else:
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel,
network_variant='',
all_networks=False,
network=(
current_service.live,
current_service.broadcast_channel,
current_service.allowed_broadcast_provider
provider,
)
)
else: