Merge branch 'master' into reset-password

Conflicts:
	app/schemas.py
	tests/app/celery/test_tasks.py
This commit is contained in:
Rebecca Law
2016-03-09 09:36:57 +00:00
18 changed files with 551 additions and 93 deletions

View File

@@ -33,19 +33,6 @@ class BaseSchema(ma.ModelSchema):
assert key is not None, "Envelope key undefined"
return key
# Code to envelope the input and response.
# TOBE added soon.
# @pre_load(pass_many=True)
# def unwrap_envelope(self, data, many):
# key = self.get_envelope_key(many)
# return data[key]
# @post_dump(pass_many=True)
# def wrap_with_envelope(self, data, many):
# key = self.get_envelope_key(many)
# return {key: data}
@post_load
def make_instance(self, data):
"""Deserialize data to an instance of the model. Update an existing row
@@ -92,6 +79,11 @@ class TemplateSchema(BaseSchema):
exclude = ("updated_at", "created_at", "service_id", "jobs")
class NotificationsStatisticsSchema(BaseSchema):
class Meta:
model = models.NotificationStatistics
class ApiKeySchema(BaseSchema):
class Meta:
model = models.ApiKey
@@ -228,3 +220,4 @@ notification_status_schema_load_json = NotificationStatusSchema(load_json=True)
invited_user_schema = InvitedUserSchema()
permission_schema = PermissionSchema()
email_data_request_schema = EmailDataSchema()
notifications_statistics_schema = NotificationsStatisticsSchema()