238 Commits

Author SHA1 Message Date
richard-dds
d1e146f577 Add create_user task 2019-09-19 16:56:36 -04:00
richard-dds
292cfdd0e8 Secrets whitelist alembic revision ids 2019-09-18 16:40:36 -04:00
richard-dds
abeadee3f3 Claim resource only temporarily 2019-09-17 11:03:33 -04:00
richard-dds
5012c5a4d3 Fix migration path 2019-09-16 16:53:03 -04:00
richard-dds
2bbe974755 Implement simple locking system for environments 2019-09-16 16:39:37 -04:00
richard-dds
89d3a66522 Apply default to environments.creator_id so column can be non-nullable 2019-09-16 15:50:05 -04:00
richard-dds
75928b7700 Fix migration path 2019-09-16 10:36:57 -04:00
richard-dds
79c8e4fc63
Merge pull request #1062 from dod-ccpo/env-provisioning-task
Environment provisioning background jobs
2019-09-16 09:58:18 -04:00
graham-dds
f3eea39536 Add "total amount" to CLINS
- includes migration for change to model
2019-09-12 16:11:10 -04:00
richard-dds
f6cb6f2a31 Change Environment.creator relation from ApplicationRole to User 2019-09-11 11:42:59 -04:00
richard-dds
e65c1d69b6 Add Environment.creator_role relation 2019-09-11 11:42:40 -04:00
richard-dds
4405ed91d5 Fix migration path 2019-09-11 11:42:36 -04:00
richard-dds
e9bf806dc6 Environment provisioning celery tasks
Failing test

Break env provisioning task into 3 separate tasks

Make env creation task idempotent

Test other env provisioning tasks

DRY tasks
2019-09-11 11:41:03 -04:00
dandds
74f012cb07 Fix migration chain. 2019-09-10 09:46:32 -04:00
leigh-mil
ebe82a3452
Merge pull request #1063 from dod-ccpo/new-member-modal-part-1
New member modal part 1
2019-09-10 09:36:36 -04:00
leigh-mil
c7d8bc260c Add phone ext column to invites and phone ext field to new member form 2019-09-09 16:24:18 -04:00
dandds
7010bdb09c Record job failures with application context.
AT-AT needs to be able to track which user tasks failed and why. To
accomplish this we:

- Enabled Celery's results backend, which logs task results to a data
  store; a Postgres table, in our case.
  (https://docs.celeryproject.org/en/latest/userguide/tasks.html#result-backends)
- Created tables to track the relationships between the relevant models
  (Environment, EnvironmentRole) and their task failures.
- Added an `on_failure` hook that tasks can use. The hook will add
  records to the job failure tables.

Now a resource like an `Environment` has access to it task failures
through the corresponding failure table.

Notes:
- It might prove useful to use a real foreign key to the Celery results
  table eventually. I did not do it here because it requires that we
  explicitly store the Celery results table schema as a migration and
  add a model for it. In the current implementation, AT-AT can be
  agnostic about where the results live.
- We store the task results indefinitely, so it is important to specify
  tasks for which we do not care about the results (like `send_mail`)
  via the `ignore_result` kwarg.
2019-09-09 14:54:46 -04:00
graham-dds
38ba8b7e5f LOAs are so out of this codebase 2019-08-30 09:57:23 -05:00
richard-dds
02900ff771 Allow TOs to be deleted, along with their associated CLINs 2019-08-08 16:03:42 -04:00
dandds
45818106c9 Squash the migrations into one reset.
This required destroying the database. The existing migrations are not
worthwhile history, though, and are available in the git history if
needed.
2019-06-19 15:29:31 -04:00
dandds
f793973da4 Do not enforce TO number uniqueness.
We don't know for a fact that TO number uniqueness is a requirement at
the database level. For now, remove the unique constraint so that users
can enter redundant TOs.
2019-06-19 13:03:41 -04:00
George Drummond
d672f5792c
Save as draft 2019-06-18 14:11:55 -04:00
George Drummond
cad43af455
Portfolio archiving 2019-06-11 11:30:37 -04:00
Montana
08c1a967ba Add jedi clin type column to clin model 2019-06-04 16:19:37 -04:00
George Drummond
f7562714cb
Add New Portfolio Workflow 2019-06-04 13:10:42 -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
755fabd725 Database changes for new portfolio invitation flow.
- user_id is nullable on role tables
- invitation tables hold basic user information
2019-06-03 15:57:49 -04:00
leigh-mil
c60e1a29f6 Add CLIN table 2019-05-31 14:49:39 -04:00
leigh-mil
fbfb04d763 Update task order table and remove dd254 2019-05-31 13:07:03 -04:00
dandds
df06d1b62f Use application_role_id on environment_roles.
In the future, an `application_invitation1 will not refer to a `user` until
someone accepts the invitation; they'll only reference an
`application_role`. When a user is invited to an application, the
inviter can specify the environments the invitee should have access to.
For this to be possible, an `environment_role` should reference an
`application_role`, because no `user` entity will be known at that time.

In addition to updating all the models and domain methods necessary for
this change, this commit deletes unused code and tests that were
dependent on `environment_roles` having a `user_id` foreign key.
2019-05-31 11:21:20 -04:00
richard-dds
a56d9c9ca8 Fix migration path 2019-05-28 10:50:38 -04:00
richard-dds
7aa238c59f Remove last_session_id server_default 2019-05-28 10:45:36 -04:00
richard-dds
9291ea497c Fix migration path 2019-05-28 10:45:12 -04:00
richard-dds
e037c81338 Only allow one session 2019-05-28 10:44:40 -04:00
leigh-mil
b3ecd1658c Add application_id column to AuditEvent
Use application_id and portfolio_id if the resource is a portfolio in AuditableMixin
Clean up some residual references to workspace
2019-05-22 13:08:44 -04:00
richard-dds
a6c5f484b9 Add NotificationSender, one test 2019-05-15 14:57:46 -04:00
dandds
054f6b80b9 add application_invitation table 2019-04-30 14:41:55 -04:00
Montana
89b5bfdef5 User no longer has unique email 2019-04-17 11:06:10 -04:00
dandds
0bde431a70 extend soft delete functionality to app and env roles 2019-04-15 15:58:38 -04:00
dandds
1c0c5dd9c5 soft deletes available for applications and environments
- parent relation will not include applications or environments marked
  as deleted
- domain classes will exclude deleted objects from selections
- changed some test factories to use domain_word for resource names,
  because they were using person names and it bugged me
2019-04-15 15:58:38 -04:00
dandds
f1bd1eea7e add application role model 2019-04-08 13:31:19 -04:00
leigh-mil
dec3a0eb48 Migration for last_login column 2019-04-03 12:24:02 -04:00
dandds
bec5d11bfe users have permission sets for site-wide perms 2019-03-21 05:38:28 -04:00
dandds
0a2e5607b9 fix migration downgrades 2019-03-15 07:14:49 -04:00
dandds
1a122c5335 rename role -> permission_set everywhere 2019-03-15 07:14:49 -04:00
dandds
0c2ab6fb7a remove portfolio_role direct relationship to role 2019-03-15 07:14:49 -04:00
dandds
31bcb662b5 add join table between portfolio_roles and roles 2019-03-15 07:14:49 -04:00
leigh-mil
8b0a11b005 Fix migration chain after rebase 2019-03-01 11:05:37 -05:00
leigh-mil
9f47f54751 Fix migration and tests after rebase 2019-03-01 11:02:16 -05:00
leigh-mil
c5e012e521 Fix migration so it will downgrade 2019-03-01 11:02:16 -05:00