93 Commits

Author SHA1 Message Date
leigh-mil
c2814416fb Update atst to atat 2020-03-04 11:51:15 -05:00
graham-dds
108f65f928 Use pendulum for datetime operations when possible
Currently, we use both Python's built-in datetime library and Pendulum
to do datetime operations. For the sake of consistency, we should try to
stick to one library for datetimes. We could have used either, but
Pendulum has a more ergonomic API, so I decided to go with it when
possible.

The places where were we didn't / couldn't replace datetime are:
- checking instances of datetimes. Pendulum's objects are subclasses of
  python native datetime objects, so it's still useful to import
  datetime in those cases of using is_instance()
- WTForms date validators expect datetime style string formats --
  Pendulum has its own format for formatting/ parsing strings. As such,
  our custom validator DateRange needs to use datetime.stptime() to
  account for this format.
2020-02-17 10:38:52 -05:00
leigh-mil
84d0a32694 Update TO form to account for new TO rules: alpha numeric, between 13 and 17 characters, dashes should be stripped, and coerce to uppercase 2020-01-24 09:18:22 -05:00
leigh-mil
36fe777230 Remove delete environments from app members form 2020-01-22 15:53:40 -05:00
graham-dds
156d733aee Add missing regex and validation for StringFields
This commit adds further validation for StringFields that were missing
it. This mostly amounted to being Regex patters and max lengths.
2020-01-22 15:20:18 -05:00
graham-dds
b3dd32f3f7 Allow Falsey values for IsNumber validator
We should use Required() instead to ensure data is present, if that's the
desired behavior
2020-01-22 15:18:42 -05:00
leigh-mil
78ef47f649 Update TO route helper function to catch error and display flash message when a user tries to save a TO with an existing number.
Update TaskOrderForm so that it converts empty string for number into None, this was causing an issue where new TOs were being saved with an empty string for the number, which violated the unique constraint.
2019-12-13 14:53:58 -05:00
leigh-mil
e8f21acf5b PR fixes 2019-11-12 16:59:22 -05:00
leigh-mil
d324ec57ec Add field for deleted in the app members environment form 2019-11-12 16:54:46 -05:00
leigh-mil
9037c44498 Move filter out of class definition and change name of form field 2019-11-12 13:07:50 -05:00
leigh-mil
ab9b62f54b Update validators and filter to remove strings that contain only
whitespace

The validator ListItemRequired() was only checking for None and an empty
string, not for strings that were multiple whitespace characters. This
fixes this issue by checking each item with regex to make sure it
contains non whitespace characters

The filter remove_empty_string() also was not checking for strings that
were multiple whitespace characters. This was also fixed by using regex
tomake sure that the string contains non whitespace characters, and also
clips any trailing whitespace.
2019-11-12 13:07:50 -05:00
leigh-mil
f4855c0ae3 Use validator on the field for checking that the pop dates are within the contract date range 2019-10-08 10:32:02 -04:00
leigh-mil
07b3c68422 Add min and max range values to date selector so a more accurate error message can be displayed when a date is out of the range 2019-10-08 10:32:02 -04:00
leigh-mil
92243965ec parse contract dates into datetime objects 2019-09-26 16:22:16 -04:00
leigh-mil
e341a73dd1 Remove unused code 2019-09-18 11:16:55 -04:00
leigh-mil
80dcb9c580 Move perms so they are at the top level of the form so that the data is properly populated
Add form fields for all environments in update member form
2019-09-18 11:16:54 -04:00
leigh-mil
4dab326eef Clean up code and formatting 2019-09-18 11:16:54 -04:00
leigh-mil
1fd2d9f496 Make form class for updating application member 2019-09-18 11:16:54 -04:00
graham-dds
c26f8b92e9 Add tests to validate CLIN funding 2019-09-12 16:11:12 -04:00
leigh-mil
ddcd91964f Remove route 'applications.update_env_roles' and related functions and tests 2019-09-11 15:29:09 -04:00
leigh-mil
2efd2c968d Use translations and make errors look pretty 2019-09-06 10:12:35 -04:00
leigh-mil
d7b86491ae Validate PoP dates against contract dates config on the backend 2019-09-06 10:12:35 -04:00
leigh-mil
c37c5d72b9 move data property into the base EnvironmentForm so that NO_ACCESS is converted to None when creating a new application member 2019-08-15 10:13:34 -04:00
leigh-mil
25ab64f748 Add validation to form for enforcing chronological order of PoP start and end dates 2019-08-01 14:45:50 -04:00
dandds
c4d8067f45 Fixes a bug where the CLIN type was not displaying correctly for saved
TOs.

The enum for the CLIN type needs to be coerced in the form data so that
the `jedi_clin_field` data is the value of the enum option. Perviously
the `jedi_clin_field` was being populated with a stringified
representation of the enum, like `JEDICLINType.JEDI_CLIN_1`.
2019-06-18 11:33:41 -04:00
George Drummond
05ed1c6d68
Remove unused validation 2019-06-17 13:33:47 -04:00
dandds
febc6f7890 Remove unused form code 2019-06-13 09:10:52 -04:00
dandds
49332c5d6e Only raise FileLength validation error on files 2019-06-10 19:26:44 -04:00
dandds
318257e32c File length validation for task order upload 2019-06-06 13:57:07 -04:00
leigh-mil
7bec073f78 Delete things related to deleted columns and table 2019-05-31 13:07:03 -04:00
Montana
c329e5ffcf Use No Access as default role value for app users
-adds unit tests for EnvironmentForm
-removes unused import from forms/team.py
2019-05-21 10:37:03 -04:00
Montana
86c6044ca1 Catch None values for IsNumber validator 2019-05-15 11:41:03 -04:00
Montana
644acc68fa Refactor application team routes
- pulling out helper functions for constructing forms
- return 400 for form validation errors
- "Yes" appears green on the read only version
2019-05-07 16:21:17 -04:00
Montana
526bcb1661 Update tests 2019-05-07 09:31:04 -04:00
dandds
926f89d975 Form for application team member table.
Nested form for each member, with child forms for environment roles and
permissions.
2019-05-06 15:15:03 -04:00
leigh-mil
355ebddf89 Add test for preventing values that are not a choice in a RadioField from being saved 2019-03-12 11:33:27 -04:00
Patrick Smith
f614a3ff83 Remove unused form fields 2019-02-25 14:54:14 -05:00
Patrick Smith
c8a139a941 Remove unused request form 2019-02-25 14:54:13 -05:00
Patrick Smith
d98abad611 Enforce email validation on edit officer forms 2019-02-04 13:19:55 -05:00
Patrick Smith
6fe9229f89 Add custom form field wrapper to determine if form data has changes 2019-01-31 14:01:55 -05:00
Patrick Smith
d43c1febea Add forms to edit TO officer information 2019-01-29 13:59:24 -05:00
Montana
d51663e075 Refactor RequiredIf validator 2019-01-20 09:50:20 -05:00
Montana
67108484be New custom validator RequiredIf 2019-01-18 09:39:52 -05:00
Montana
684786bffc Remove unused import 2019-01-17 10:45:13 -05:00
Montana
ae494d3bb5 Refactor RequiredIfNot custom validator, add tests 2019-01-16 11:00:51 -05:00
dandds
3fc323d785 project -> application everywhere 2019-01-14 16:00:17 -05:00
dandds
e509c34cdd change name of request relationship to legacy task order 2018-12-13 11:36:45 -05:00
Patrick Smith
891dcc5b31 Keep list of required fields on user model 2018-10-30 15:32:04 -04:00
Patrick Smith
2e89f38601 Require all fields on user profile form 2018-10-30 15:32:04 -04:00
richard-dds
09d3f33908
Merge pull request #387 from dod-ccpo/save-finver-draft
Save Financial Verification Draft
2018-10-29 10:26:30 -04:00