From c4222fac470563157f4a3e35df8bc4713f68ca79 Mon Sep 17 00:00:00 2001 From: annagav Date: Fri, 6 Dec 2024 08:14:20 -0800 Subject: [PATCH 1/3] Populate max min weekly hours (#2488) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- cms/migrations/0042_populate_weekly_hours.py | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cms/migrations/0042_populate_weekly_hours.py diff --git a/cms/migrations/0042_populate_weekly_hours.py b/cms/migrations/0042_populate_weekly_hours.py new file mode 100644 index 000000000..43618a222 --- /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 + ), + ] From 1b2b6669cf66b31094da1ec4f43fa3d0be283917 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:17:29 +0000 Subject: [PATCH 2/3] fix(deps): update dependency django to v4.2.17 [security] (#2490) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index f02cb980d..106cfc68d 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 ef5c6530a..693ef5f90 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" From 6445c988a75c1307ca9d1bf58a582ab20c6ee656 Mon Sep 17 00:00:00 2001 From: Doof Date: Mon, 9 Dec 2024 18:35:02 +0000 Subject: [PATCH 3/3] Release 0.107.0 --- RELEASE.rst | 6 ++++++ main/settings.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE.rst b/RELEASE.rst index 1725b27b5..0f87ebc73 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/main/settings.py b/main/settings.py index 168078dba..56123f564 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()