Skip to content

Commit

Permalink
Rename adapter mixins to have Mixin in the class name
Browse files Browse the repository at this point in the history
  • Loading branch information
amstilp committed Jul 3, 2024
1 parent 7720627 commit 8314a91
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions primed/cdsa/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from anvil_consortium_manager.models import Workspace

from primed.miscellaneous_workspaces.tables import DataPrepWorkspaceUserTable
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapter, WorkspaceAuthDomainAdapter
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapterMixin, WorkspaceAuthDomainAdapterMixin
from primed.primed_anvil.forms import WorkspaceAuthDomainDisabledForm

from . import forms, models, tables


class CDSAWorkspaceAdapter(WorkspaceAuthDomainAdapter, WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class CDSAWorkspaceAdapter(WorkspaceAuthDomainAdapterMixin, WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for CDSAWorkspaces."""

type = "cdsa"
Expand Down
6 changes: 3 additions & 3 deletions primed/collaborative_analysis/adapters.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from anvil_consortium_manager.adapters.workspace import BaseWorkspaceAdapter

from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapter, WorkspaceAuthDomainAdapter
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapterMixin, WorkspaceAuthDomainAdapterMixin
from primed.primed_anvil.forms import WorkspaceAuthDomainDisabledForm

from . import forms, models, tables


class CollaborativeAnalysisWorkspaceAdapter(
WorkspaceAuthDomainAdapter,
WorkspaceAdminSharingAdapter,
WorkspaceAuthDomainAdapterMixin,
WorkspaceAdminSharingAdapterMixin,
BaseWorkspaceAdapter,
):
"""Adapter for CollaborativeAnalysisWorkspace."""
Expand Down
4 changes: 2 additions & 2 deletions primed/dbgap/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from anvil_consortium_manager.models import Workspace

from primed.miscellaneous_workspaces.tables import DataPrepWorkspaceUserTable
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapter, WorkspaceAuthDomainAdapter
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapterMixin, WorkspaceAuthDomainAdapterMixin
from primed.primed_anvil.forms import WorkspaceAuthDomainDisabledForm

from . import forms, models, tables


class dbGaPWorkspaceAdapter(WorkspaceAuthDomainAdapter, WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class dbGaPWorkspaceAdapter(WorkspaceAuthDomainAdapterMixin, WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for dbGaPWorkspaces."""

type = "dbgap"
Expand Down
14 changes: 7 additions & 7 deletions primed/miscellaneous_workspaces/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from anvil_consortium_manager.adapters.workspace import BaseWorkspaceAdapter
from anvil_consortium_manager.forms import WorkspaceForm

from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapter
from primed.primed_anvil.adapters import WorkspaceAdminSharingAdapterMixin
from primed.primed_anvil.tables import (
DefaultWorkspaceStaffTable,
DefaultWorkspaceUserTable,
Expand All @@ -12,7 +12,7 @@
from . import forms, models, tables


class SimulatedDataWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class SimulatedDataWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for SimulatedDataWorkspaces."""

type = "simulated_data"
Expand All @@ -26,7 +26,7 @@ class SimulatedDataWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceA
workspace_detail_template_name = "miscellaneous_workspaces/simulateddataworkspace_detail.html"


class ConsortiumDevelWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class ConsortiumDevelWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for ConsortiumDevelWorkspaces."""

type = "devel"
Expand All @@ -40,7 +40,7 @@ class ConsortiumDevelWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspac
workspace_detail_template_name = "anvil_consortium_manager/workspace_detail.html"


class ResourceWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class ResourceWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for ResourceWorkspaces."""

type = "resource"
Expand All @@ -54,7 +54,7 @@ class ResourceWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapte
workspace_detail_template_name = "anvil_consortium_manager/workspace_detail.html"


class TemplateWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class TemplateWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for TemplateWorkspaces."""

type = "template"
Expand All @@ -68,7 +68,7 @@ class TemplateWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapte
workspace_detail_template_name = "anvil_consortium_manager/workspace_detail.html"


class OpenAccessWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class OpenAccessWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for TemplateWorkspaces."""

type = "open_access"
Expand All @@ -82,7 +82,7 @@ class OpenAccessWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdap
workspace_detail_template_name = "miscellaneous_workspaces/openaccessworkspace_detail.html"


class DataPrepWorkspaceAdapter(WorkspaceAdminSharingAdapter, BaseWorkspaceAdapter):
class DataPrepWorkspaceAdapter(WorkspaceAdminSharingAdapterMixin, BaseWorkspaceAdapter):
"""Adapter for DataPrepWorkspace."""

type = "data_prep"
Expand Down
4 changes: 2 additions & 2 deletions primed/primed_anvil/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_autocomplete_label(self, account):
return "{} ({})".format(name, account.email)


class WorkspaceAuthDomainAdapter:
class WorkspaceAuthDomainAdapterMixin:
"""Helper class to add auth domains to workspaces."""

def before_anvil_create(self, workspace):
Expand All @@ -57,7 +57,7 @@ def before_anvil_create(self, workspace):
membership.anvil_create()


class WorkspaceAdminSharingAdapter:
class WorkspaceAdminSharingAdapterMixin:
"""Helper class to share workspaces with the PRIMED_CC_ADMINs group."""

def after_anvil_create(self, workspace):
Expand Down

0 comments on commit 8314a91

Please sign in to comment.