mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Replace DurationChoices by JobIntervalChoices
This commit is contained in:
parent
b1ac20ac19
commit
f9431f1c29
@ -81,8 +81,10 @@ class JobIntervalChoices(ChoiceSet):
|
|||||||
CHOICES = (
|
CHOICES = (
|
||||||
(INTERVAL_MINUTELY, _('Minutely')),
|
(INTERVAL_MINUTELY, _('Minutely')),
|
||||||
(INTERVAL_HOURLY, _('Hourly')),
|
(INTERVAL_HOURLY, _('Hourly')),
|
||||||
|
(INTERVAL_HOURLY * 12, _('12 hours')),
|
||||||
(INTERVAL_DAILY, _('Daily')),
|
(INTERVAL_DAILY, _('Daily')),
|
||||||
(INTERVAL_WEEKLY, _('Weekly')),
|
(INTERVAL_WEEKLY, _('Weekly')),
|
||||||
|
(INTERVAL_DAILY * 30, _('30 days')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,17 +178,6 @@ class LogLevelChoices(ChoiceSet):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DurationChoices(ChoiceSet):
|
|
||||||
|
|
||||||
CHOICES = (
|
|
||||||
(60, _('Hourly')),
|
|
||||||
(720, _('12 hours')),
|
|
||||||
(1440, _('Daily')),
|
|
||||||
(10080, _('Weekly')),
|
|
||||||
(43200, _('30 days')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Webhooks
|
# Webhooks
|
||||||
#
|
#
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from extras.choices import DurationChoices
|
from core.choices import JobIntervalChoices
|
||||||
from utilities.forms.widgets import DateTimePicker, NumberWithOptions
|
from utilities.forms.widgets import DateTimePicker, NumberWithOptions
|
||||||
from utilities.datetime import local_now
|
from utilities.datetime import local_now
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ class ReportForm(forms.Form):
|
|||||||
min_value=1,
|
min_value=1,
|
||||||
label=_("Recurs every"),
|
label=_("Recurs every"),
|
||||||
widget=NumberWithOptions(
|
widget=NumberWithOptions(
|
||||||
options=DurationChoices
|
options=JobIntervalChoices
|
||||||
),
|
),
|
||||||
help_text=_("Interval at which this report is re-run (in minutes)")
|
help_text=_("Interval at which this report is re-run (in minutes)")
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from extras.choices import DurationChoices
|
from core.choices import JobIntervalChoices
|
||||||
from utilities.forms.widgets import DateTimePicker, NumberWithOptions
|
from utilities.forms.widgets import DateTimePicker, NumberWithOptions
|
||||||
from utilities.datetime import local_now
|
from utilities.datetime import local_now
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ class ScriptForm(forms.Form):
|
|||||||
min_value=1,
|
min_value=1,
|
||||||
label=_("Recurs every"),
|
label=_("Recurs every"),
|
||||||
widget=NumberWithOptions(
|
widget=NumberWithOptions(
|
||||||
options=DurationChoices
|
options=JobIntervalChoices
|
||||||
),
|
),
|
||||||
help_text=_("Interval at which this script is re-run (in minutes)")
|
help_text=_("Interval at which this script is re-run (in minutes)")
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user