# Generated by Django 5.0.7 on 2024-07-31 17:06

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import recurrence.fields
import timezone_field.fields

class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('core', '0064_rrule_model'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='calendarevent',
            name='timezone_if_datetime_start',
        ),
        migrations.RemoveConstraint(
            model_name='calendarevent',
            name='timezone_if_datetime_end',
        ),
        migrations.AlterField(
            model_name='calendarevent',
            name='recurrences',
            field=recurrence.fields.RecurrenceField(blank=True, default='', verbose_name='Recurrences'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='calendarevent',
            name='timezone',
            field=timezone_field.fields.TimeZoneField(blank=True, default='', verbose_name='Timezone'),
            preserve_default=False,
        ),
        migrations.AddConstraint(
            model_name='calendarevent',
            constraint=models.CheckConstraint(condition=models.Q(('datetime_start__isnull', False), ('timezone', ''),
                                                             models.Q(('recurrences', ''), _negated=True),
                                                             _negated=True),
                                              name='timezone_if_datetime_start_and_recurring'),
        ),
        migrations.AddConstraint(
            model_name='calendarevent',
            constraint=models.CheckConstraint(condition=models.Q(('datetime_end__isnull', False), ('timezone', ''),
                                                             models.Q(('recurrences', ''), _negated=True),
                                                             _negated=True),
                                              name='timezone_if_datetime_end_and_recurring'),
        ),
    ]
