diff --git a/RELEASE.rst b/RELEASE.rst index 1725b27b5e..0f87ebc73b 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -1,6 +1,12 @@ Release Notes ============= +Version 0.107.0 +--------------- + +- fix(deps): update dependency django to v4.2.17 [security] (#2490) +- Populate max min weekly hours (#2488) + Version 0.106.1 (Released December 09, 2024) --------------- diff --git a/cms/migrations/0042_populate_weekly_hours.py b/cms/migrations/0042_populate_weekly_hours.py new file mode 100644 index 0000000000..43618a222e --- /dev/null +++ b/cms/migrations/0042_populate_weekly_hours.py @@ -0,0 +1,42 @@ +# Generated by Django 4.2.16 on 2024-12-05 19:39 +import re + +from django.db import migrations + + +def populate_weekly_hours_fields(apps, schema_editor): + CoursePage = apps.get_model("cms", "CoursePage") + for page in CoursePage.objects.all(): + if page.effort: + effort_str = page.effort.lower() + effort_nums = re.findall(r"\d+", effort_str) + if len(effort_nums) > 0: + page.min_weekly_hours = effort_nums[0] + page.max_weekly_hours = ( + effort_nums[1] if len(effort_nums) > 1 else effort_nums[0] + ) + page.save() + + ProgramPage = apps.get_model("cms", "ProgramPage") + for page in ProgramPage.objects.all(): + if page.effort: + effort_str = page.effort.lower() + effort_nums = re.findall(r"\d+", effort_str) + if len(effort_nums) > 0: + page.min_weekly_hours = effort_nums[0] + page.max_weekly_hours = ( + effort_nums[1] if len(effort_nums) > 1 else effort_nums[0] + ) + page.save() + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0041_populate_min_weeks"), + ] + + operations = [ + migrations.RunPython( + populate_weekly_hours_fields, reverse_code=migrations.RunPython.noop + ), + ] diff --git a/main/settings.py b/main/settings.py index 168078dbad..56123f5642 100644 --- a/main/settings.py +++ b/main/settings.py @@ -29,7 +29,7 @@ from main.celery_utils import OffsettingSchedule from main.sentry import init_sentry -VERSION = "0.106.1" +VERSION = "0.107.0" log = logging.getLogger() diff --git a/poetry.lock b/poetry.lock index f02cb980db..106cfc68d9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -905,13 +905,13 @@ files = [ [[package]] name = "django" -version = "4.2.16" +version = "4.2.17" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." optional = false python-versions = ">=3.8" files = [ - {file = "Django-4.2.16-py3-none-any.whl", hash = "sha256:1ddc333a16fc139fd253035a1606bb24261951bbc3a6ca256717fa06cc41a898"}, - {file = "Django-4.2.16.tar.gz", hash = "sha256:6f1616c2786c408ce86ab7e10f792b8f15742f7b7b7460243929cb371e7f1dad"}, + {file = "Django-4.2.17-py3-none-any.whl", hash = "sha256:3a93350214ba25f178d4045c0786c61573e7dbfa3c509b3551374f1e11ba8de0"}, + {file = "Django-4.2.17.tar.gz", hash = "sha256:6b56d834cc94c8b21a8f4e775064896be3b4a4ca387f2612d4406a5927cd2fdc"}, ] [package.dependencies] @@ -4063,4 +4063,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "3.9.18" -content-hash = "047221220af1b829ba7d029f1a9e9c363ff189dda61118362a6100e75d7275cf" +content-hash = "ba648f8b870037637a01d07020f43de9fb69a1635a2181d75e27b8e1c3c48897" diff --git a/pyproject.toml b/pyproject.toml index ef5c6530a5..693ef5f908 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ celery = "^5.2.2" celery-redbeat = "^2.0.0" deepdiff = "^6.6.1" dj-database-url = "^0.5.0" -django = "4.2.16" +django = "4.2.17" django-anymail = {extras = ["mailgun"], version = "^11.1"} django-cors-headers = "^4.0.0" django-countries = "^7.2.1"