Skip to content

Commit

Permalink
Upgrade to cronsim 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cuu508 committed Apr 26, 2023
1 parent 9ead449 commit 9ddae08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Improvements
- Switch from CssAbsoluteFilter to CssRelativeFilter (#822)
- Add statsd metric collection in hc.lib.s3.get_object()
- Upgrade to cronsim 2.4

## v2.8.1 - 2023-04-11

Expand Down
12 changes: 1 addition & 11 deletions hc/front/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from urllib.parse import urlencode, urlparse
from uuid import UUID

from cron_descriptor import ExpressionDescriptor
from cronsim import CronSim, CronSimError
from django.conf import settings
from django.contrib import messages
Expand Down Expand Up @@ -596,19 +595,10 @@ def cron_preview(request):
it = CronSim(schedule, now_local)
for i in range(0, 6):
ctx["dates"].append(next(it))
ctx["desc"] = it.explain()
except (CronSimError, StopIteration):
ctx["bad_schedule"] = True

if ctx["dates"]:
try:
descriptor = ExpressionDescriptor(schedule, use_24hour_time_format=True)
ctx["desc"] = descriptor.get_description()
except:
# We assume the schedule is valid if cronsim accepts it.
# If cron-descriptor throws an exception, don't show the description
# to the user.
pass

return render(request, "front/cron_preview.html", ctx)


Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cron-descriptor==1.2.35
cronsim==2.3
cronsim==2.4
Django==4.2
django-compressor==4.3.1
fido2==1.1.0
fido2==1.1.1
psycopg2==2.9.6
pycurl==7.45.2
pyotp==2.8.0
Expand Down

0 comments on commit 9ddae08

Please sign in to comment.