rename template.serialize to serialize_for_v2

make it clear that this is for the public api, and we shouldn't add
fields to it without considering impacts

also add the broadcast_messages relationship on service and template to
the exclude from the marshmallow schemas, so it's not included elsewhere
This commit is contained in:
Leo Hemsted
2020-07-06 16:41:53 +01:00
parent 5f337f7914
commit 0282a76bf7
7 changed files with 10 additions and 10 deletions

View File

@@ -991,7 +991,7 @@ class TemplateBase(db.Model):
template.values = values
return template
def serialize(self):
def serialize_for_v2(self):
serialized = {
"id": str(self.id),
"type": self.template_type,
@@ -1009,7 +1009,6 @@ class TemplateBase(db.Model):
for key in self._as_utils_template().placeholders
},
"postage": self.postage,
"broadcast_data": self.broadcast_data
}
return serialized