Skip to content

Commit

Permalink
Merge pull request #250 from UW-GAC/deploy/stage
Browse files Browse the repository at this point in the history
Deploy to prod
  • Loading branch information
amstilp authored Oct 5, 2023
2 parents 0503f04 + cc1d537 commit 3b44800
Show file tree
Hide file tree
Showing 61 changed files with 5,721 additions and 655 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# ahead of planned upgrades we can add versions as
# needed
python-version: [3.8]
mariadb-version: ["10.3"]
mariadb-version: ["10.3", "10.4"]

services:
mysql:
Expand Down
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")
2 changes: 2 additions & 0 deletions primed/cdsa/adapters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from anvil_consortium_manager.adapters.workspace import BaseWorkspaceAdapter
from anvil_consortium_manager.forms import WorkspaceForm

from . import forms, models, tables

Expand All @@ -12,6 +13,7 @@ class CDSAWorkspaceAdapter(BaseWorkspaceAdapter):
"Workspaces containing data from the Consortium Data Sharing Agreement."
)
list_table_class = tables.CDSAWorkspaceTable
workspace_form_class = WorkspaceForm
workspace_data_model = models.CDSAWorkspace
workspace_data_form_class = forms.CDSAWorkspaceForm
workspace_detail_template_name = "cdsa/cdsaworkspace_detail.html"
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

0 comments on commit 3b44800

Please sign in to comment.