diff --git a/app/main/forms.py b/app/main/forms.py index ee04143e5..7f784d0aa 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -2430,11 +2430,18 @@ class ServiceBroadcastNetworkForm(StripWhitespaceForm): thing='a mobile network', ) + @property + def account_type(self): + if self.network_variant.data == f'live-{self.broadcast_channel}-all': + provider = 'all' + else: + provider = self.network.provider_restriction + + return f'live-{self.broadcast_channel}-{provider}' + def validate_network(self, field): if not self.network_variant.data and not field.data: raise ValidationError('Select a mobile network') - if self.network_variant.data == 'all': - field.data = '' class ServiceBroadcastAccountTypeForm(StripWhitespaceForm): diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 8006e8492..f9ef5cef2 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -381,7 +381,7 @@ def service_set_broadcast_network(service_id, broadcast_channel): return redirect(url_for( '.service_confirm_broadcast_account_type', service_id=current_service.id, - account_type=form.network_variant.data or form.network.data, + account_type=form.account_type, )) return render_template(