mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
First slice of csv upload of phone numbers for sending messages.
At the moment the file contents are not persisted by checked in memory. The first and last three records are show if all are valid. If there are invalid rows, they are reported and the user is prompted to go back and sort out upload file. The storing of upload result (i.e. validation of file) in session will be removed in next story which is about persisting of file for later processing.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from flask_wtf import Form
|
||||
from wtforms import StringField, PasswordField, ValidationError
|
||||
from wtforms import StringField, PasswordField, ValidationError, FileField
|
||||
from wtforms.validators import DataRequired, Email, Length, Regexp
|
||||
from app.main.validators import Blacklist, ValidateUserCodes
|
||||
|
||||
from app.main.validators import Blacklist, ValidateUserCodes, CsvFileValidator
|
||||
from app.main.dao import verify_codes_dao
|
||||
from app.main.encryption import check_hash
|
||||
|
||||
|
||||
def email_address():
|
||||
@@ -127,3 +130,9 @@ class ForgotPasswordForm(Form):
|
||||
|
||||
class NewPasswordForm(Form):
|
||||
new_password = password()
|
||||
|
||||
|
||||
class CsvUploadForm(Form):
|
||||
file = FileField('File to upload',
|
||||
validators=[DataRequired(message='Please pick a file'),
|
||||
CsvFileValidator()])
|
||||
|
||||
Reference in New Issue
Block a user