# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

# Generated by Django 4.2.3 on 2023-07-27 09:06

import uuid

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

import weblate.utils.fields


class Migration(migrations.Migration):
    dependencies = [
        ("weblate_auth", "0028_alter_autogroup_match"),
    ]

    operations = [
        migrations.CreateModel(
            name="Invitation",
            fields=[
                (
                    "uuid",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                (
                    "email",
                    weblate.utils.fields.EmailField(
                        blank=True, max_length=190, verbose_name="E-mail"
                    ),
                ),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="User has all possible permissions.",
                        verbose_name="Superuser status",
                    ),
                ),
                (
                    "group",
                    models.ForeignKey(
                        help_text="The user is granted all permissions included in membership of these groups.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="weblate_auth.group",
                        verbose_name="Group",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        help_text="Please type in an existing Weblate account name or e-mail address.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="User to add",
                    ),
                ),
                (
                    "author",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="created_invitation_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
    ]
