30 Commits

Author SHA1 Message Date
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
graham-dds
ccaabcaab0 Add revoke invitation logic to port. admin route 2019-10-28 13:15:42 -04:00
graham-dds
a1c672d89f Conditionally skip tests related to audit log 2019-10-21 11:36:53 -04:00
leigh-mil
875b908908 Do not change app role status when invite status changes, add assertions to tests for this 2019-10-03 14:56:38 -04:00
leigh-mil
91e41199b7 Update TO form based on new model 2019-06-05 12:58:33 -04:00
dandds
c085db23d7 New invitation backend for portfolio invitations.
Portfolio invitations do not associate a user entity until the
invitation has been accepted. User info, including DOD ID, is held on
the invitation itself. When a user accepts and invitation, their user
entry is associated with the corresponding `portfolio_role` entry.

The same change will be applied to `application_role` and application
invitations. For now, small changes have been made to
application-related methods so that that flow works as-is.
2019-06-03 15:57:49 -04:00
dandds
4f304d747e Small tweaks for adding a new application member:
- raise specific invitation type if invite not found in invitation domain classes
- more terse assignments of defaults in invitation service, smh
- terser margin expression for inline input fields
- sass formatting
- use translation for cancel link
- oxford comma for app team management permission explanation
- do not format environment roles with hyphens for role selection
- generalize some additional methods in the invitation domain base class
- use plain atst.models import path
2019-04-30 17:14:58 -04:00
dandds
c4ad7b4378 Make portfolio invitation specific to portfolio
- add a base domain class
- extract shared model code to mixin
- rename invitation classes
- invitation model relationship to portfolio_role name is now more
  generic "role"
2019-04-30 14:41:55 -04:00
dandds
4a0dd2d432 remove unused domain methods and arguments 2019-03-22 06:31:20 -04:00
George Drummond
d57b96cf05
wip 2019-03-12 09:59:16 -04:00
dandds
d3d36822df workspace -> portfolio everywhere 2019-01-14 16:00:17 -05:00
Montana
9ddac1fa61 Prevent invitations without a workspace role 2018-12-03 16:49:59 -05:00
richard-dds
e6aa4663d4 Better error handling for Auditable class 2018-12-03 15:32:27 -05:00
richard-dds
c5342cacd4 Include extra details in Invitation AuditEvent 2018-11-29 11:11:41 -05:00
leigh-mil
385878e1ab Resend workspace invitations to email submitted in new member form. 2018-11-27 16:59:20 -05:00
richard-dds
a725310535 Resend a workspace member's invite 2018-11-13 14:39:44 -05:00
richard-dds
280f0162ed Fix new test 2018-11-13 14:39:44 -05:00
richard-dds
024c695f66 Simplify Invitations.create signature 2018-11-13 14:39:44 -05:00
dandds
75dd0f1249 domain method revoking invitations 2018-11-06 16:29:00 -05:00
dandds
e4bad109db more granular invitation status and a display status for workspace members 2018-11-01 13:52:03 -04:00
dandds
cb25dcdd32 invitation cannot be reused if wrong user accepts it 2018-10-31 14:53:52 -04:00
dandds
87baa1f873 more fine-grained errors for invalid invitations 2018-10-31 14:53:52 -04:00
dandds
b3cd08a64f invitation can only be accepted by user with matching DOD ID 2018-10-31 14:53:51 -04:00
dandds
848bbf9c12 Updates to workspace role permissions, invitations 2018-10-31 10:21:48 -04:00
dandds
151d5be5ea use invite token instead of id for invitation url 2018-10-31 10:21:48 -04:00
dandds
5c5f9c6c9c record expiration time on the invitation 2018-10-31 10:21:48 -04:00
dandds
d5998ed370 track invitation state by status enum 2018-10-31 10:21:48 -04:00
dandds
6125041a93 record inviter on invitation 2018-10-31 10:21:48 -04:00
dandds
edede87108 specify unit for invitation expiration 2018-10-31 10:21:48 -04:00
dandds
b8fc92cd14 basic invitation model with domain class 2018-10-31 10:21:48 -04:00