mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Change schema format name of datetime format
Renamed the 'datetime' format to 'datetime_within_next_day'. This format is used to validate the date and time of scheduled notifications, not to check the format of a datetime.
This commit is contained in:
@@ -29,7 +29,7 @@ def validate(json_to_validate, schema):
|
|||||||
validate_email_address(instance)
|
validate_email_address(instance)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@format_checker.checks('datetime', raises=ValidationError)
|
@format_checker.checks('datetime_within_next_day', raises=ValidationError)
|
||||||
def validate_schema_date_with_hour(instance):
|
def validate_schema_date_with_hour(instance):
|
||||||
if isinstance(instance, str):
|
if isinstance(instance, str):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ post_sms_request = {
|
|||||||
"phone_number": {"type": "string", "format": "phone_number"},
|
"phone_number": {"type": "string", "format": "phone_number"},
|
||||||
"template_id": uuid,
|
"template_id": uuid,
|
||||||
"personalisation": personalisation,
|
"personalisation": personalisation,
|
||||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime"},
|
"scheduled_for": {"type": ["string", "null"], "format": "datetime_within_next_day"},
|
||||||
"sms_sender_id": uuid
|
"sms_sender_id": uuid
|
||||||
},
|
},
|
||||||
"required": ["phone_number", "template_id"],
|
"required": ["phone_number", "template_id"],
|
||||||
@@ -182,7 +182,7 @@ post_email_request = {
|
|||||||
"email_address": {"type": "string", "format": "email_address"},
|
"email_address": {"type": "string", "format": "email_address"},
|
||||||
"template_id": uuid,
|
"template_id": uuid,
|
||||||
"personalisation": personalisation,
|
"personalisation": personalisation,
|
||||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime"},
|
"scheduled_for": {"type": ["string", "null"], "format": "datetime_within_next_day"},
|
||||||
"email_reply_to_id": uuid
|
"email_reply_to_id": uuid
|
||||||
},
|
},
|
||||||
"required": ["email_address", "template_id"],
|
"required": ["email_address", "template_id"],
|
||||||
|
|||||||
Reference in New Issue
Block a user