mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-09 19:04:05 -04: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)
|
||||
return True
|
||||
|
||||
@format_checker.checks('datetime', raises=ValidationError)
|
||||
@format_checker.checks('datetime_within_next_day', raises=ValidationError)
|
||||
def validate_schema_date_with_hour(instance):
|
||||
if isinstance(instance, str):
|
||||
try:
|
||||
|
||||
@@ -136,7 +136,7 @@ post_sms_request = {
|
||||
"phone_number": {"type": "string", "format": "phone_number"},
|
||||
"template_id": uuid,
|
||||
"personalisation": personalisation,
|
||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime"},
|
||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime_within_next_day"},
|
||||
"sms_sender_id": uuid
|
||||
},
|
||||
"required": ["phone_number", "template_id"],
|
||||
@@ -182,7 +182,7 @@ post_email_request = {
|
||||
"email_address": {"type": "string", "format": "email_address"},
|
||||
"template_id": uuid,
|
||||
"personalisation": personalisation,
|
||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime"},
|
||||
"scheduled_for": {"type": ["string", "null"], "format": "datetime_within_next_day"},
|
||||
"email_reply_to_id": uuid
|
||||
},
|
||||
"required": ["email_address", "template_id"],
|
||||
|
||||
Reference in New Issue
Block a user