61 lines
2.0 KiB
Python
61 lines
2.0 KiB
Python
|
# Generated by Django 4.1.3 on 2022-11-18 01:40
|
||
|
|
||
|
import django.db.models.deletion
|
||
|
from django.conf import settings
|
||
|
from django.db import migrations, models
|
||
|
|
||
|
import stator.models
|
||
|
import users.models.password_reset
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
("users", "0003_user_last_seen_alter_identity_domain"),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.CreateModel(
|
||
|
name="PasswordReset",
|
||
|
fields=[
|
||
|
(
|
||
|
"id",
|
||
|
models.BigAutoField(
|
||
|
auto_created=True,
|
||
|
primary_key=True,
|
||
|
serialize=False,
|
||
|
verbose_name="ID",
|
||
|
),
|
||
|
),
|
||
|
("state_ready", models.BooleanField(default=True)),
|
||
|
("state_changed", models.DateTimeField(auto_now_add=True)),
|
||
|
("state_attempted", models.DateTimeField(blank=True, null=True)),
|
||
|
("state_locked_until", models.DateTimeField(blank=True, null=True)),
|
||
|
(
|
||
|
"state",
|
||
|
stator.models.StateField(
|
||
|
choices=[("new", "new"), ("sent", "sent")],
|
||
|
default="new",
|
||
|
graph=users.models.password_reset.PasswordResetStates,
|
||
|
max_length=100,
|
||
|
),
|
||
|
),
|
||
|
("token", models.CharField(max_length=500, unique=True)),
|
||
|
("new_account", models.BooleanField()),
|
||
|
("created", models.DateTimeField(auto_now_add=True)),
|
||
|
("updated", models.DateTimeField(auto_now=True)),
|
||
|
(
|
||
|
"user",
|
||
|
models.ForeignKey(
|
||
|
on_delete=django.db.models.deletion.CASCADE,
|
||
|
related_name="password_resets",
|
||
|
to=settings.AUTH_USER_MODEL,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
options={
|
||
|
"abstract": False,
|
||
|
},
|
||
|
),
|
||
|
]
|