From 9ada8ad11ee85f047894d0e919f446496d27398c Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Mon, 7 Jun 2021 17:36:55 +0100 Subject: [PATCH] Remove redundant code to populate account type This field is now only used on the confirmation page of the settings form, where we pre-populate it with the hyphenated string it expects. --- app/main/forms.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index b54f78de4..5d714fd53 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -2365,21 +2365,6 @@ class GoLiveNotesForm(StripWhitespaceForm): class ServiceBroadcastAccountTypeField(GovukRadiosField): - # When receiving Python data, eg when instantiating the form object - # we want to convert it from a tuple of - # (service_mode, broadcast_channel, allowed_broadcast_provider) - # to a value to be used in our form such as "live-severe-ee" - def process_data(self, value): - if not value or isinstance(value, str): - return super().process_data(value) - (live, broadcast_channel, allowed_broadcast_provider) = value - account_type = None - if broadcast_channel: - account_type = "live" if live else "training" - account_type += f"-{broadcast_channel}-{allowed_broadcast_provider}" - - self.data = account_type - # After validation we split the value back into its parts of service_mode # broadcast_channel and provider_restriction to be used by the flask route to send to the # API