# Generated by Django 5.1.7 on 2025-03-17 18:09

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
        ('user', '0005_remove_user_email_or_login_set_and_more'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='user',
            name='email_or_login_set',
        ),
        migrations.AddField(
            model_name='user',
            name='is_managed',
            field=models.BooleanField(default=False, help_text='User with restricted functionality.', verbose_name='Is Managed'),
        ),
        migrations.AddConstraint(
            model_name='user',
            constraint=models.CheckConstraint(condition=models.Q(('email__isnull', False), ('login__isnull', False), _connector='OR'), name='email_or_login_set', violation_error_message='E-Mail or Login must be set'),
        ),
        migrations.AddConstraint(
            model_name='user',
            constraint=models.CheckConstraint(condition=models.Q(models.Q(('email__isnull', False), ('is_managed', False)), models.Q(('email__isnull', True), ('is_managed', True)), _connector='OR'), name='no_email_for_managed_user', violation_error_message='Managed users must not have an E-Mail address'),
        ),
    ]
