mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 15:41:06 -04:00
Validate date format on new platform admin page
Check that the format of the dates entered is in the `YYYY-MM-DD` as specified and show an error message if it is not. If the date was not in the specified format, there would be no error message but the content of the page would change which was misleading.
This commit is contained in:
@@ -50,9 +50,11 @@ def platform_admin():
|
||||
@login_required
|
||||
@user_is_platform_admin
|
||||
def platform_admin_new():
|
||||
form = DateFilterForm(request.args)
|
||||
form = DateFilterForm(request.args, meta={'csrf': False})
|
||||
api_args = {}
|
||||
|
||||
form.validate()
|
||||
|
||||
if form.start_date.data:
|
||||
api_args['start_date'] = form.start_date.data
|
||||
api_args['end_date'] = form.end_date.data or datetime.utcnow().date()
|
||||
|
||||
Reference in New Issue
Block a user