mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 13:41:38 -04:00
[WIP] Attempt at adding a form to the platform admin page is not working well for me here. But I want to commit it so I can look at it again.
This commit is contained in:
@@ -16,8 +16,8 @@ from wtforms import (
|
||||
HiddenField,
|
||||
IntegerField,
|
||||
RadioField,
|
||||
FieldList
|
||||
)
|
||||
FieldList,
|
||||
DateField)
|
||||
from wtforms.fields.html5 import EmailField, TelField
|
||||
from wtforms.validators import (DataRequired, Email, Length, Regexp, Optional)
|
||||
|
||||
@@ -516,3 +516,16 @@ class Whitelist(Form):
|
||||
max_entries=5,
|
||||
label="Mobile numbers"
|
||||
)
|
||||
|
||||
|
||||
class DateFilterForm(Form):
|
||||
start_date = DateField("Start Date", [validators.optional()])
|
||||
end_date = StringField("End Date", [validators.optional()])
|
||||
|
||||
def validate(self):
|
||||
print("****In validate")
|
||||
if self.start_date.data and not self.end_date.data:
|
||||
print("***** false {}".format(type(self.end_date.errors)))
|
||||
raise ValidationError('Both required')
|
||||
else:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user