Skip to content
Snippets Groups Projects
Verified Commit 356ffbc2 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix constraint for datetime_start before datetime_end

parent 277e87ee
No related branches found
No related tags found
1 merge request!1710Fix constraint for datetime_start before datetime_end
Pipeline #195829 failed
......@@ -10,7 +10,7 @@ class Migration(migrations.Migration):
operations = [
migrations.AddConstraint(
model_name='calendarevent',
constraint=models.CheckConstraint(check=Q(datetime_end__gt=F('datetime_start')),
constraint=models.CheckConstraint(check=Q(datetime_end__gte=F('datetime_start')),
name="datetime_start_before_end"
),
),
......
......@@ -1707,7 +1707,7 @@ class CalendarEvent(CalendarEventMixin, ExtensiblePolymorphicModel, RecurrenceMo
name="datetime_end_or_date_end",
),
models.CheckConstraint(
check=Q(datetime_end__gt=F("datetime_start")), name="datetime_start_before_end"
check=Q(datetime_end__gte=F("datetime_start")), name="datetime_start_before_end"
),
models.CheckConstraint(
check=Q(date_end__gte=F("date_start")), name="date_start_before_end"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment