From 881043ebfc8f778613e1f2ebe541c6888e8673be Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Aug 2025 10:15:34 +0200 Subject: [PATCH] DRAFT: Pin cron-descriptor v2 --- django_celery_beat/models.py | 10 +++------- requirements/default.txt | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/django_celery_beat/models.py b/django_celery_beat/models.py index ad53a288..0696790d 100644 --- a/django_celery_beat/models.py +++ b/django_celery_beat/models.py @@ -8,8 +8,8 @@ import timezone_field from celery import current_app, schedules -from cron_descriptor import (FormatException, MissingFieldException, - WrongArgumentException, get_description) +from cron_descriptor import (FormatError, MissingFieldError, + WrongArgumentError, get_description) from django.conf import settings from django.core.exceptions import MultipleObjectsReturned, ValidationError from django.core.validators import MaxValueValidator, MinValueValidator @@ -339,11 +339,7 @@ def human_readable(self): ) try: human_readable = get_description(cron_expression) - except ( - MissingFieldException, - FormatException, - WrongArgumentException - ): + except (FormatError, MissingFieldError, WrongArgumentError): return f'{cron_expression} {str(self.timezone)}' return f'{human_readable} {str(self.timezone)}' diff --git a/requirements/default.txt b/requirements/default.txt index 03c129a9..86580290 100644 --- a/requirements/default.txt +++ b/requirements/default.txt @@ -4,4 +4,4 @@ django-timezone-field>=5.0 backports.zoneinfo; python_version<"3.9" tzdata python-crontab>=2.3.4 -cron-descriptor>=1.2.32 +cron-descriptor>=2.0.0