diff --git a/eox_tenant/settings/common.py b/eox_tenant/settings/common.py index 234062d7..6d849eb5 100644 --- a/eox_tenant/settings/common.py +++ b/eox_tenant/settings/common.py @@ -13,7 +13,8 @@ INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', - 'eox_tenant' + 'eox_tenant', + 'organizations', ] TIME_ZONE = 'UTC' diff --git a/eox_tenant/utils.py b/eox_tenant/utils.py index bff85b3c..255949d7 100644 --- a/eox_tenant/utils.py +++ b/eox_tenant/utils.py @@ -5,6 +5,7 @@ import re import six +from organizations.models import Organization from eox_tenant.edxapp_wrapper.users import get_user_signup_source from eox_tenant.models import TenantOrganization @@ -104,3 +105,4 @@ def synchronize_tenant_organizations(instance): for org in course_org_filter: organization, _ = TenantOrganization.objects.get_or_create(name=org) instance.organizations.add(organization) + Organization.objects.get_or_create(name=org, short_name=org) diff --git a/requirements/base.in b/requirements/base.in index 955cdab5..6bf89e62 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -11,3 +11,4 @@ edx-opaque-keys[django] openedx_filters social-auth-core edx-drf-extensions +edx-organizations diff --git a/requirements/base.txt b/requirements/base.txt index d4d1c911..7b2b7d2c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -10,7 +10,7 @@ backports-zoneinfo==0.2.1 # via # django # djangorestframework -certifi==2024.2.2 +certifi==2024.6.2 # via requests cffi==1.16.0 # via @@ -20,7 +20,7 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via edx-django-utils -cryptography==42.0.7 +cryptography==42.0.8 # via # pyjwt # social-auth-core @@ -30,23 +30,32 @@ defusedxml==0.8.0rc2 # social-auth-core django==4.2.13 # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.in # django-crum + # django-model-utils # django-mysql # django-waffle # djangorestframework # drf-jwt # edx-django-utils # edx-drf-extensions + # edx-organizations # jsonfield # openedx-filters django-crum==0.7.9 # via # -r requirements/base.in # edx-django-utils +django-model-utils==4.5.1 + # via edx-organizations django-mysql==4.13.0 # via -r requirements/base.in +django-simple-history==3.0.0 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # edx-organizations django-waffle==4.1.0 # via # edx-django-utils @@ -56,18 +65,24 @@ djangorestframework==3.15.1 # -r requirements/base.in # drf-jwt # edx-drf-extensions + # edx-organizations dnspython==2.6.1 # via pymongo drf-jwt==1.19.2 # via edx-drf-extensions -edx-django-utils==5.14.1 +edx-django-utils==5.14.2 # via edx-drf-extensions edx-drf-extensions==10.3.0 - # via -r requirements/base.in + # via + # -r requirements/base.in + # edx-organizations edx-opaque-keys[django]==2.9.0 # via # -r requirements/base.in # edx-drf-extensions + # edx-organizations +edx-organizations==6.13.0 + # via -r requirements/base.in idna==3.7 # via requests jsonfield==3.1.0 @@ -82,6 +97,8 @@ openedx-filters==1.8.1 # via -r requirements/base.in pbr==6.0.0 # via stevedore +pillow==10.3.0 + # via edx-organizations psutil==5.9.8 # via edx-django-utils pycparser==2.22 @@ -116,9 +133,12 @@ stevedore==5.2.0 # via # edx-django-utils # edx-opaque-keys -typing-extensions==4.12.0 +typing-extensions==4.12.1 # via # asgiref # edx-opaque-keys urllib3==2.2.1 # via requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 0f023b86..3a9696a9 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -9,3 +9,6 @@ # linking to it here is good. Django<5 + +# Common constraints for Open edX repos +-c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8460d793..fd530e4a 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -8,8 +8,10 @@ build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==7.1.0 - # via build +importlib-metadata==6.11.0 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # build packaging==24.0 # via build pip-tools==7.4.1 @@ -24,7 +26,7 @@ tomli==2.0.1 # pip-tools wheel==0.43.0 # via pip-tools -zipp==3.19.0 +zipp==3.19.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index 16df1c41..214ac120 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -15,7 +15,7 @@ backports-zoneinfo==0.2.1 # -r requirements/base.txt # django # djangorestframework -certifi==2024.2.2 +certifi==2024.6.2 # via # -r requirements/base.txt # requests @@ -34,7 +34,7 @@ click==8.1.7 # edx-django-utils coverage==7.5.3 # via -r requirements/test.in -cryptography==42.0.7 +cryptography==42.0.8 # via # -r requirements/base.txt # pyjwt @@ -49,15 +49,18 @@ defusedxml==0.8.0rc2 dill==0.3.8 # via pylint # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.txt # django-crum + # django-model-utils # django-mysql # django-waffle # djangorestframework # drf-jwt # edx-django-utils # edx-drf-extensions + # edx-organizations # jsonfield # openedx-filters django-crum==0.7.9 @@ -66,8 +69,17 @@ django-crum==0.7.9 # edx-django-utils django-fake-model==0.1.4 # via -r requirements/test.in +django-model-utils==4.5.1 + # via + # -r requirements/base.txt + # edx-organizations django-mysql==4.13.0 # via -r requirements/base.txt +django-simple-history==3.0.0 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/base.txt + # edx-organizations django-waffle==4.1.0 # via # -r requirements/base.txt @@ -78,6 +90,7 @@ djangorestframework==3.15.1 # -r requirements/base.txt # drf-jwt # edx-drf-extensions + # edx-organizations dnspython==2.6.1 # via # -r requirements/base.txt @@ -86,16 +99,21 @@ drf-jwt==1.19.2 # via # -r requirements/base.txt # edx-drf-extensions -edx-django-utils==5.14.1 +edx-django-utils==5.14.2 # via # -r requirements/base.txt # edx-drf-extensions edx-drf-extensions==10.3.0 - # via -r requirements/base.txt + # via + # -r requirements/base.txt + # edx-organizations edx-opaque-keys[django]==2.9.0 # via # -r requirements/base.txt # edx-drf-extensions + # edx-organizations +edx-organizations==6.13.0 + # via -r requirements/base.txt idna==3.7 # via # -r requirements/base.txt @@ -127,6 +145,10 @@ pbr==6.0.0 # via # -r requirements/base.txt # stevedore +pillow==10.3.0 + # via + # -r requirements/base.txt + # edx-organizations platformdirs==4.2.2 # via pylint psutil==5.9.8 @@ -194,7 +216,7 @@ tomli==2.0.1 # via pylint tomlkit==0.12.5 # via pylint -typing-extensions==4.12.0 +typing-extensions==4.12.1 # via # -r requirements/base.txt # asgiref @@ -205,3 +227,6 @@ urllib3==2.2.1 # via # -r requirements/base.txt # requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools