12 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
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
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
graham-dds
c26f8b92e9 Add tests to validate CLIN funding 2019-09-12 16:11:12 -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
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