mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-05 08:59:10 -04:00
remove dvla_organisation and other unused things
dvla_organisation, branding_dict, a weird `branding` property on
update_service. all gone 💥
This commit is contained in:
@@ -886,27 +886,6 @@ class CreateOrUpdateOrganisation(StripWhitespaceForm):
|
||||
name = StringField('Name', validators=[DataRequired()])
|
||||
|
||||
|
||||
class LetterBranding(StripWhitespaceForm):
|
||||
|
||||
def __init__(self, choices=[], *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.dvla_org_id.choices = list(sorted(
|
||||
choices,
|
||||
key=lambda choice: (
|
||||
choice[0] != kwargs.get('dvla_org_id'),
|
||||
choice[0] != '001',
|
||||
choice[1],
|
||||
),
|
||||
))
|
||||
|
||||
dvla_org_id = RadioField(
|
||||
'Which logo should this service’s letter have?',
|
||||
validators=[
|
||||
DataRequired()
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
class EmailFieldInWhitelist(EmailField, StripWhitespaceStringField):
|
||||
pass
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ from app.main.forms import (
|
||||
ConfirmPasswordForm,
|
||||
FreeSMSAllowance,
|
||||
InternationalSMSForm,
|
||||
LetterBranding,
|
||||
LinkOrganisationsForm,
|
||||
OrganisationTypeForm,
|
||||
RenameServiceForm,
|
||||
@@ -55,7 +54,6 @@ from app.main.forms import (
|
||||
from app.utils import (
|
||||
AgreementInfo,
|
||||
email_safe,
|
||||
get_logo_cdn_domain,
|
||||
user_has_permissions,
|
||||
user_is_gov_user,
|
||||
user_is_platform_admin,
|
||||
@@ -775,7 +773,6 @@ def service_set_email_branding(service_id):
|
||||
return render_template(
|
||||
'views/service-settings/set-email-branding.html',
|
||||
form=form,
|
||||
branding_dict=get_branding_as_dict(email_branding),
|
||||
search_form=SearchTemplatesForm(),
|
||||
show_search_box=(len(email_branding) > 6)
|
||||
)
|
||||
@@ -961,15 +958,6 @@ def get_branding_as_value_and_label(email_branding):
|
||||
]
|
||||
|
||||
|
||||
def get_branding_as_dict(email_branding):
|
||||
return {
|
||||
branding['id']: {
|
||||
'logo': 'https://{}/{}'.format(get_logo_cdn_domain(), branding['logo']),
|
||||
'colour': branding['colour']
|
||||
} for branding in email_branding
|
||||
}
|
||||
|
||||
|
||||
def convert_dictionary_to_wtforms_choices_format(dictionary, value, label):
|
||||
return [
|
||||
(item[value], item[label]) for item in dictionary
|
||||
|
||||
@@ -23,7 +23,6 @@ class Service():
|
||||
ALLOWED_PROPERTIES = {
|
||||
'active',
|
||||
'contact_link',
|
||||
'dvla_organisation',
|
||||
'email_branding',
|
||||
'email_from',
|
||||
'id',
|
||||
|
||||
@@ -14,12 +14,7 @@ class LetterBrandingClient(NotifyAdminAPIClient):
|
||||
brandings.sort(key=lambda branding: branding[sort_key].lower())
|
||||
return brandings
|
||||
|
||||
def get_letter_branding_id_for_domain(self, domain):
|
||||
for branding in self.get_all_letter_branding():
|
||||
if domain and branding.get('domain') == domain:
|
||||
return branding['id']
|
||||
return None
|
||||
|
||||
@cache.delete('letter_branding')
|
||||
def create_letter_branding(self, filename, name, domain):
|
||||
data = {
|
||||
"filename": filename,
|
||||
|
||||
@@ -74,11 +74,9 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
'research_mode',
|
||||
'sms_sender',
|
||||
'created_by',
|
||||
'branding',
|
||||
'letter_branding',
|
||||
'email_branding',
|
||||
'letter_contact_block',
|
||||
'dvla_organisation',
|
||||
'permissions',
|
||||
'organisation_type',
|
||||
'free_sms_fragment_limit',
|
||||
|
||||
Reference in New Issue
Block a user