mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Rename JSONModel to SerialisedModel 2/2
This class doesn’t actually wrap JSON, it wraps serialised data. So this name feels better.
This commit is contained in:
@@ -21,7 +21,7 @@ from app.notifications.process_notifications import create_content_for_notificat
|
||||
from app.utils import get_public_notify_type_text
|
||||
from app.dao.service_email_reply_to_dao import dao_get_reply_to_by_id
|
||||
from app.dao.service_letter_contact_dao import dao_get_letter_contact_by_id
|
||||
from app.serialised_models import TemplateJSONModel
|
||||
from app.serialised_models import SerialisedTemplate
|
||||
|
||||
from gds_metrics.metrics import Histogram
|
||||
|
||||
@@ -159,7 +159,7 @@ def check_notification_content_is_not_empty(template_with_content):
|
||||
def validate_template(template_id, personalisation, service, notification_type):
|
||||
|
||||
try:
|
||||
template = TemplateJSONModel.from_id_and_service_id(template_id, service.id)
|
||||
template = SerialisedTemplate.from_id_and_service_id(template_id, service.id)
|
||||
except NoResultFound:
|
||||
message = 'Template not found'
|
||||
raise BadRequestError(message=message,
|
||||
|
||||
@@ -3,7 +3,7 @@ from abc import ABC, abstractmethod
|
||||
from app.dao import templates_dao
|
||||
|
||||
|
||||
class JSONModel(ABC):
|
||||
class SerialisedModel(ABC):
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
@@ -18,7 +18,7 @@ class JSONModel(ABC):
|
||||
return super().__dir__() + list(sorted(self.ALLOWED_PROPERTIES))
|
||||
|
||||
|
||||
class TemplateJSONModel(JSONModel):
|
||||
class SerialisedTemplate(SerialisedModel):
|
||||
ALLOWED_PROPERTIES = {
|
||||
'archived',
|
||||
'content',
|
||||
|
||||
Reference in New Issue
Block a user