From 6adfdbabe0d44c17f32abc9d48a6e252e2a0792e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 17 Nov 2022 19:16:34 -0700 Subject: Add signup and password reset --- users/migrations/0004_passwordreset.py | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 users/migrations/0004_passwordreset.py (limited to 'users/migrations') diff --git a/users/migrations/0004_passwordreset.py b/users/migrations/0004_passwordreset.py new file mode 100644 index 0000000..d996ff4 --- /dev/null +++ b/users/migrations/0004_passwordreset.py @@ -0,0 +1,60 @@ +# 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, + }, + ), + ] -- cgit v1.2.3