-
Notifications
You must be signed in to change notification settings - Fork 0
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
CDSA invalidation #233
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is to handle a page for agreement versions - it's a little clearer.
This view shows the set of signed agreements that exist with this agreement version.
Add a table for AgreementVersion as well as a detail view and a url. Add a link in the navbar to this view.
This is not a true detail view, but displays information about the major_version associated with one or more agreement_versions. Add a url, a view, a template, and tests.
Add a get_major_version_absolute_url method to AgreementVersion. Link to this url in relevant tables and detail pages.
Codecov Report
@@ Coverage Diff @@
## main #233 +/- ##
==========================================
+ Coverage 97.81% 97.98% +0.16%
==========================================
Files 208 219 +11
Lines 14488 15652 +1164
==========================================
+ Hits 14172 15336 +1164
Misses 316 316
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Add a model definition, a factory, and tests. This model will be used as a foreign key in AgreementVersion.
This fk will be populated in a following data migration using the values in major_version.
This data migration does two things: 1. Create an AgreementMajorVersion record for each unique major_version in AgreementVersion. 2. Set major_version_fk to the appropriate AgreementMajorVersion instance for each AgreementVersion instance. Also add tests for the migration. Add the django-test-migrations package to the requirements file for local development, since it is used in tests.
Remove the previous major_version field and rename the temporary major_version_fk field to major_version. Note that a lot of the code will be broken since we didn't udpate any of it yet for these changes. Rename the constraint, since mysql/mariadb will likely complain if we don't.
Instead of only migrating from before the data migration to immediately after, migrate from the first migration before any of the changes (initial) to the last migration in the set (0007) in tests. This is a better test of what is actually happening (and what we actually want to happen).
Instead of having AgreementMajorVersion be a template view that operates on a non-existent model class, use a detail view that pulls and instance of the AgreementMajorVersion model. Add a get_absolute_url method to AgreementMajorVersion, and remove the get_major_version_absolute_url method from AgreementVersion since it is no longer necessary. Update tables and templates as necessary for the removal of this method.
Also modify the table dictionaries/table columns to use accessors instead of passing each value in the table dictionary (eg, signed agreement types can be derived from the signed_agreement using an accessor instead of passed separately).
This field indicates if the version is a valid CDSA or a deprecated CDSA. Also display this information in the AgreementVersionTable as a column as well on various detail pages as a pill.
We don't need the custom managers and overhead that comes along with the StatusModel for AgreementMajorVersion, since we can't access the model manager methods via the foreign key relationships and the AgreementMajorVersion model is rarely used directly.
Rename BooleanCheckColumn to BooleanIconColumn, which is a more representative of what the column is now doing. Add an init argument that allows the user to specify if they would like icons to be displayed for "False" values. For the AgreementVersionTable, show the false icon.
Modify the SignedAgreementForm version queryset to include only AgreementVersions whose major version is valid. Add a test to check this.
This update also refactored the code and the tests quite a bit, which makes it a little easier to read (hopefully). Add more tests.
Similar to the SignedAgreement audit. Expand tests.
This field will indicate if a signed agreement is active or replaced (or other statuses as added in the future).
In addition to checking whether the agreement version is valid, the SignedAgreementAudit now checks whether the agreement is active.
In addition to checking if the workspace has a valid CDSA, also check that that CDSA is active.
Add a view that updates the status of a SignedAgreement. Add three different urls that use this view, one for each agreement type. Note that the the different urls need to pass the correct agreement_type as a kwarg to the view. I decided to do this because then the urls are more consistent with the detail views, eg: cdsa/signed_agreements/members/1 (for the detail view) and cdsa/signed_agreements/members/1/update (for the update view) Also add a form that is used in this view, tests for the form, and tests for the view.
This status is intended to be used for SignedAgreements whose major version became invalid but were not withdrawn.
If the major version associated with a signed agreement is not valid but the SignedAgreement is still active, still allow that SignedAgreement to have access to the CDSA (and any workspaces associated with that DataAffiliate CDSA's study). We decided that the view to invalidate an AgreementMajorVersion instance would also set the status to LAPSED for all SignedAgreements associated with that version. This gives us additional flexibility if we need in the future (eg, we can change a LAPSED SignedAgreement to ACTIVE if we need to extend their access for some reason). Therefore, we only need to consider the status of the SignedAgreement (and its associated primary, if applicable).
This view invalidates a given AgreementMajorVerison instance and also sets the status of all associated agreements to Lapsed.
This button is only shown if the user has edit permission and the version is valid.
Only records associated with an active SignedAgreement are shown in the tables.
Instead of hardcoding the CDSA group name as "PRIMED_CDSA", use the name specified in the settings file.
Some questions:
|
This is no longer needed, since we use the AgreementMajorVersion foreign key to determine validity.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP
SignedAgreements
with choices Active, Lapsed, or Withdrawn.Closes #195