Skip to content

Commit

Permalink
feat: learners-count statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
shadinaif committed Mar 8, 2024
1 parent 03d5b4c commit 3d9a001
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""functions for getting statistics about learners"""
9 changes: 9 additions & 0 deletions futurex_openedx_extensions/helpers/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""helpers Django application initialization"""

from django.apps import AppConfig


class HelpersConfig(AppConfig):
"""Configuration for the helpers Django application"""

name = 'helpers'
14 changes: 14 additions & 0 deletions futurex_openedx_extensions/helpers/tenant.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
),
Expand All @@ -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',
],
},
)

0 comments on commit 3d9a001

Please sign in to comment.