Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDSA invalidation #233

Merged
merged 54 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d9b98ae
Change namespace to signed_agreements instead of agreements
amstilp Aug 30, 2023
b815665
Add a detail view for an AgreementVersion
amstilp Aug 30, 2023
459b468
Add a get_absolute_url method for an AgreementVersion
amstilp Aug 30, 2023
9a20157
Link to the AgreementVersion detail in signed agreement tables
amstilp Aug 30, 2023
ec20d68
Fix header in AgreementVersion detail template
amstilp Aug 30, 2023
6ed59fe
Add a view to list AgreementVersions
amstilp Aug 30, 2023
403d471
Add a "detail" view for an agreement major version
amstilp Aug 30, 2023
2b0d1d0
Link to the agreement major version "detail" where appropriate
amstilp Aug 30, 2023
617e669
Remove cc_id from records table
amstilp Aug 31, 2023
90c6b3d
Add a model for AgreementMajorVersion
amstilp Aug 31, 2023
9eb3b42
Add a nullable major_version_fk to the AgreementVersion model
amstilp Aug 31, 2023
c98c9de
Add a data migration to populate AgreementMajorVersion and fk
amstilp Aug 31, 2023
c4f20ef
Replace existing major_version field with the new foreign key
amstilp Aug 31, 2023
e8733d7
Do not allow major_version to be blank or null
amstilp Aug 31, 2023
8c5b4ce
Modify the migration test to cover the set of related migrations
amstilp Aug 31, 2023
d2e8da1
Add the AgreementMajorVersion model to the admin
amstilp Aug 31, 2023
6b0c201
Fix models.py for major_version changes
amstilp Aug 31, 2023
111ba2c
Update factories and models for major_version change
amstilp Aug 31, 2023
830b125
Update AgreementVersionDetail for major_version changes
amstilp Sep 1, 2023
4abbe28
Update AgreementMajorVersionDetail to be a DetailView
amstilp Sep 1, 2023
2196357
Remove now-extraneous v from AgreementVersionTable
amstilp Sep 1, 2023
13e0e62
Add dev CDSA group setting back to local config
amstilp Sep 1, 2023
b5c1c8d
Add CSDA version to audit tables
amstilp Sep 1, 2023
4d81748
Modify test data script for migration changes
amstilp Sep 1, 2023
1741f72
Add a status field to AgreementMajorVersion
amstilp Sep 13, 2023
936f325
Use a boolean field for instead of a status field
amstilp Sep 13, 2023
b45f27d
Add keyword to specify if False icons should be shown
amstilp Sep 14, 2023
df5eca0
Only allow valid AgreementVersions to be selected for SignedAgreements
amstilp Sep 14, 2023
20f52aa
Add version to the RepresentativeRecords table
amstilp Sep 14, 2023
a0e1452
Add method to check if a signed agreement is in the CDSA group
amstilp Sep 15, 2023
7882302
Update SignedAgreementAudit to handle invalid major versions
amstilp Sep 15, 2023
20257e5
Update CDSA workspace audit to handle invalid major versions
amstilp Sep 19, 2023
a13beb6
Add a status field to the SignedAgreement model
amstilp Sep 19, 2023
dac962a
Add status to SignedAgreement tables
amstilp Sep 19, 2023
b78d6aa
Add status field to admin displays
amstilp Sep 19, 2023
fd21357
Show SignedAgreement status on detail pages
amstilp Sep 19, 2023
a1fc49f
Test that status was set correctly in Create views
amstilp Sep 19, 2023
b541626
Remove commented out tests that were previously replaced
amstilp Sep 19, 2023
0021dfd
Update SignedAgreementAudit to check status field
amstilp Sep 19, 2023
6ac2df5
Add status check into CDSAWorkspace access audit
amstilp Sep 19, 2023
5f79c6b
Add view to update a SignedAgreement status
amstilp Sep 19, 2023
f266c7e
Change allowed status options to ACTIVE and WITHDRAWN
amstilp Sep 20, 2023
19328c7
Add the LAPSED status to SignedAgreement status choices
amstilp Sep 20, 2023
2e5cb62
Add docstrings to SignedAgreement statuses
amstilp Sep 20, 2023
12fd6a0
Rework audit such that AgreementMajorVersion is_valid is ignored
amstilp Sep 20, 2023
c3fbfcf
Add a view to invalidate major agreement versions
amstilp Sep 22, 2023
5917a0e
Add an invalidate button to the AgreementMajorVersion detail template
amstilp Sep 22, 2023
5e16d6a
Update CDSA records tables to only show active records
amstilp Sep 22, 2023
1a2d5fe
Update audit templates for SignedAgreement status info
amstilp Sep 22, 2023
662efcb
Show button to change status on SignedAgreement detail pages
amstilp Sep 22, 2023
8cd56a8
Create the correct CDSA group name for example data
amstilp Sep 25, 2023
7c44629
Fix typos
amstilp Sep 29, 2023
6f630c4
Merge branch 'main' into feature/cdsa-invalidation
amstilp Sep 29, 2023
3dd387f
Remove is_valid propery from AgreementVersion model
amstilp Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions add_cdsa_example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ManagedGroupFactory,
WorkspaceGroupSharingFactory,
)
from django.conf import settings

from primed.cdsa.tests import factories
from primed.duo.tests.factories import DataUseModifierFactory, DataUsePermissionFactory
Expand All @@ -17,16 +18,23 @@
from primed.users.models import User
from primed.users.tests.factories import UserFactory

# Create major versions
major_version = factories.AgreementMajorVersionFactory.create(version=1)

# Create some agreement versions
v10 = factories.AgreementVersionFactory.create(major_version=1, minor_version=0)
v11 = factories.AgreementVersionFactory.create(major_version=1, minor_version=1)
v10 = factories.AgreementVersionFactory.create(
major_version=major_version, minor_version=0
)
v11 = factories.AgreementVersionFactory.create(
major_version=major_version, minor_version=1
)

# Create a couple signed CDSAs.
dup = DataUsePermissionFactory.create(abbreviation="GRU")
dum = DataUseModifierFactory.create(abbreviation="NPU")

# create the CDSA auth group
cdsa_group = ManagedGroupFactory.create(name="PRIMED_CDSA")
cdsa_group = ManagedGroupFactory.create(name=settings.ANVIL_CDSA_GROUP_NAME)

# Create some study sites.
StudySiteFactory.create(short_name="CARDINAL", full_name="CARDINAL")
Expand Down
1 change: 1 addition & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@
ANVIL_DATA_ACCESS_GROUP_PREFIX = env(
"ANVIL_DATA_ACCESS_GROUP_PREFIX", default="DEV_PRIMED"
)
ANVIL_CDSA_GROUP_NAME = env("ANVIL_CDSA_GROUP_NAME", default="DEV_PRIMED_CDSA")
30 changes: 26 additions & 4 deletions primed/cdsa/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@
from . import models


@admin.register(models.AgreementMajorVersion)
class AgreementMajorVersion(SimpleHistoryAdmin):
"""Admin class for the `AgreementMajorVersion` model."""

list_display = (
"version",
"is_valid",
)
list_filter = (
"version",
"is_valid",
)
sortable_by = ("version",)


@admin.register(models.AgreementVersion)
class AgreementVersion(SimpleHistoryAdmin):
"""Admin class for the `AgreementVersion` model."""

list_display = (
"full_version",
"major_version",
"minor_version",
"date_approved",
)
list_filter = ("major_version",)
list_filter = (
"major_version",
"major_version__is_valid",
)
sortable_by = (
"major_version",
"minor_version",
Expand All @@ -38,6 +54,7 @@ class SignedAgreement(SimpleHistoryAdmin):
"type",
"is_primary",
"version",
"status",
)
search_fields = (
"representative",
Expand All @@ -63,6 +80,7 @@ class MemberAgreementAdmin(SimpleHistoryAdmin):
list_filter = (
"study_site",
"signed_agreement__is_primary",
"signed_agreement__status",
)


Expand All @@ -77,6 +95,7 @@ class DataAffiliateAgreementAdmin(SimpleHistoryAdmin):
list_filter = (
"study",
"signed_agreement__is_primary",
"signed_agreement__status",
)


Expand All @@ -88,7 +107,10 @@ class NonDataAffiliateAgreementAdmin(SimpleHistoryAdmin):
"signed_agreement",
"affiliation",
)
list_filter = ("signed_agreement__is_primary",)
list_filter = (
"signed_agreement__is_primary",
"signed_agreement__status",
)


@admin.register(models.CDSAWorkspace)
Expand Down
Loading