From f223cfcb30414f0a4c2c010f3f240d3a88972f2a Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Wed, 1 Jul 2020 14:25:51 +0200 Subject: [PATCH] Removing value check --- django_q/models.py | 2 -- django_q/tests/test_scheduler.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/django_q/models.py b/django_q/models.py index 8ec5907..f2ba852 100644 --- a/django_q/models.py +++ b/django_q/models.py @@ -138,8 +138,6 @@ class Failure(Task): # Optional Cron validator def validate_cron(value): - if not value: - return if not croniter: raise ImportError(_("Please install croniter to enable cron expressions")) try: diff --git a/django_q/tests/test_scheduler.py b/django_q/tests/test_scheduler.py index 4625bfa..50f6c5b 100644 --- a/django_q/tests/test_scheduler.py +++ b/django_q/tests/test_scheduler.py @@ -102,11 +102,11 @@ def test_scheduler(broker, monkeypatch): assert cron_schedule.full_clean() is None assert cron_schedule.__unicode__() == 'django_q.tests.tasks.word_multiply' with pytest.raises(ValidationError): - cron_schedule = create_schedule('django_q.tests.tasks.word_multiply', - 2, - word='django', - schedule_type=Schedule.CRON, - cron="0 22 * * 1-12") + create_schedule('django_q.tests.tasks.word_multiply', + 2, + word='django', + schedule_type=Schedule.CRON, + cron="0 22 * * 1-12") # All other types for t in Schedule.TYPE: if t[0] == Schedule.CRON: