Remove computed SMS prefix

This is no longer used no that the column in the table (`prefix_sms`) is
populated.
This commit is contained in:
Chris Hill-Scott
2017-11-07 10:59:26 +00:00
parent f3f8225dfe
commit ac885dd4e6
4 changed files with 2 additions and 18 deletions

View File

@@ -48,13 +48,11 @@ def send_sms_to_provider(notification):
)
template_model = dao_get_template_by_id(notification.template_id, notification.template_version)
sender_has_been_customised = (not service.get_prefix_sms_with_service_name())
template = SMSMessageTemplate(
template_model.__dict__,
values=notification.personalisation,
prefix=service.name,
sender=sender_has_been_customised,
show_prefix=service.prefix_sms,
)
if service.research_mode or notification.key_type == KEY_TYPE_TEST:

View File

@@ -283,11 +283,6 @@ class Service(db.Model, Versioned):
default_letter_contact = [x for x in self.letter_contacts if x.is_default]
return default_letter_contact[0].contact_block if default_letter_contact else None
def get_prefix_sms_with_service_name(self):
if self.prefix_sms is not None:
return self.prefix_sms
return self.get_default_sms_sender() == current_app.config['FROM_NUMBER']
class AnnualBilling(db.Model):
__tablename__ = "annual_billing"

View File

@@ -209,7 +209,6 @@ class ServiceSchema(BaseSchema):
reply_to_email_address = fields.Method(method_name="get_reply_to_email_address")
sms_sender = fields.Method(method_name="get_sms_sender")
letter_contact_block = fields.Method(method_name="get_letter_contact")
prefix_sms_with_service_name = fields.Method(method_name="get_prefix_sms_with_service_name")
def service_permissions(self, service):
return [p.permission for p in service.permissions]
@@ -223,9 +222,6 @@ class ServiceSchema(BaseSchema):
def get_letter_contact(self, service):
return service.get_default_letter_contact()
def get_prefix_sms_with_service_name(self, service):
return service.get_prefix_sms_with_service_name()
class Meta:
model = models.Service
dump_only = ['reply_to_email_address', 'letter_contact_block']