add created_by to notifications

this is so one-off notifications can be tied to a user
(jobs have a created_by, and api notifications don't make sense
 to have one)
This commit is contained in:
Leo Hemsted
2017-06-13 15:33:33 +01:00
parent 8a49afc06c
commit 9f307fd1c5
4 changed files with 50 additions and 0 deletions

View File

@@ -444,6 +444,7 @@ class NotificationWithTemplateSchema(BaseSchema):
dump_only=True
)
job = fields.Nested(JobSchema, only=["id", "original_file_name"], dump_only=True)
created_by = fields.Nested(UserSchema, only=['id', 'name', 'email_address'], dump_only=True)
status = fields.String(required=False)
personalisation = fields.Dict(required=False)
key_type = field_for(models.Notification, 'key_type', required=True)