agendas: add a flag to enable check of future events (#75277)
This commit is contained in:
parent
970ba42075
commit
0a9e36883c
|
@ -0,0 +1,18 @@
|
|||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('agendas', '0146_event_bigautofield'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='agenda',
|
||||
name='enable_check_for_future_events',
|
||||
field=models.BooleanField(
|
||||
default=False, verbose_name='Enable the check of bookings when event has not passed'
|
||||
),
|
||||
),
|
||||
]
|
|
@ -227,6 +227,9 @@ class Agenda(models.Model):
|
|||
disable_check_update = models.BooleanField(
|
||||
_('Prevent the check of bookings when event was marked as checked'), default=False
|
||||
)
|
||||
enable_check_for_future_events = models.BooleanField(
|
||||
_('Enable the check of bookings when event has not passed'), default=False
|
||||
)
|
||||
booking_check_filters = models.CharField(
|
||||
_('Filters'),
|
||||
max_length=250,
|
||||
|
|
|
@ -1415,6 +1415,7 @@ class AgendaBookingCheckSettingsForm(forms.ModelForm):
|
|||
'booking_check_filters',
|
||||
'mark_event_checked_auto',
|
||||
'disable_check_update',
|
||||
'enable_check_for_future_events',
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
{% endwith %}
|
||||
<li>{% trans "Automatically mark event as checked when all bookings have been checked:" %} {{ agenda.mark_event_checked_auto|yesno }}</li>
|
||||
<li>{% trans "Prevent the check of bookings when event was marked as checked:" %} {{ agenda.disable_check_update|yesno }}</li>
|
||||
<li>{% trans "Enable the check of bookings when event has not passed:" %} {{ agenda.enable_check_for_future_events|yesno }}</li>
|
||||
</ul>
|
||||
<div class="panel--buttons">
|
||||
<a rel="popup" class="button" href="{% url 'chrono-manager-agenda-booking-check-settings' pk=object.pk %}">{% trans 'Configure' %}</a>
|
||||
|
|
|
@ -689,6 +689,14 @@ def test_options_agenda_booking_check_options(app, admin_user):
|
|||
agenda.refresh_from_db()
|
||||
assert agenda.disable_check_update is True
|
||||
|
||||
# check enable check future events
|
||||
assert agenda.enable_check_for_future_events is False
|
||||
resp = app.get(url)
|
||||
resp.form['enable_check_for_future_events'] = True
|
||||
resp = resp.form.submit()
|
||||
agenda.refresh_from_db()
|
||||
assert agenda.enable_check_for_future_events is True
|
||||
|
||||
# check kind
|
||||
agenda.kind = 'meetings'
|
||||
agenda.save()
|
||||
|
|
Loading…
Reference in New Issue