diff --git a/futurex_openedx_extensions/dashboard/statistics/__init__.py b/futurex_openedx_extensions/dashboard/statistics/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/futurex_openedx_extensions/dashboard/statistics/learners.py b/futurex_openedx_extensions/dashboard/statistics/learners.py new file mode 100644 index 00000000..b795e484 --- /dev/null +++ b/futurex_openedx_extensions/dashboard/statistics/learners.py @@ -0,0 +1 @@ +"""functions for getting statistics about learners""" diff --git a/futurex_openedx_extensions/helpers/apps.py b/futurex_openedx_extensions/helpers/apps.py new file mode 100644 index 00000000..cea81a09 --- /dev/null +++ b/futurex_openedx_extensions/helpers/apps.py @@ -0,0 +1,9 @@ +"""helpers Django application initialization""" + +from django.apps import AppConfig + + +class HelpersConfig(AppConfig): + """Configuration for the helpers Django application""" + + name = 'helpers' diff --git a/futurex_openedx_extensions/helpers/tenant.py b/futurex_openedx_extensions/helpers/tenant.py new file mode 100644 index 00000000..7596debe --- /dev/null +++ b/futurex_openedx_extensions/helpers/tenant.py @@ -0,0 +1,14 @@ +"""Tenant management helpers""" + + +def get_accessible_tenants(user): + """ + Get the tenants that the user has access to. + + Args: + user (User): The user to check. + + Returns: + list of Tenant: The tenants that the user has access to. + """ + return Tenant.objects.filter(users=user) diff --git a/setup.py b/setup.py index 25bb3c47..7beaf092 100755 --- a/setup.py +++ b/setup.py @@ -138,6 +138,7 @@ def is_requirement(line): include=[ 'futurex_openedx_extensions', 'futurex_openedx_extensions.*', 'futurex_openedx_extensions.dashboard', 'futurex_openedx_extensions.dashboard.*', + 'futurex_openedx_extensions.helpers', 'futurex_openedx_extensions.helpers.*', ], exclude=["*tests"], ), @@ -160,6 +161,7 @@ def is_requirement(line): entry_points={ 'lms.djangoapp': [ 'dashboard = futurex_openedx_extensions.dashboard.apps:DashboardConfig', + 'helpers = futurex_openedx_extensions.helpers.apps:HelpersConfig', ], }, )