diff options
author | Andrew Godwin | 2022-11-17 19:16:34 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-17 19:16:34 -0700 |
commit | 6adfdbabe0d44c17f32abc9d48a6e252e2a0792e (patch) | |
tree | 6644c5eeab7970a9f9b8d9540b7ebe28cc499331 /users/migrations | |
parent | 2a3690d1c148da5dd799052403ba7290e1fb7de0 (diff) | |
download | takahe-6adfdbabe0d44c17f32abc9d48a6e252e2a0792e.tar.gz takahe-6adfdbabe0d44c17f32abc9d48a6e252e2a0792e.tar.bz2 takahe-6adfdbabe0d44c17f32abc9d48a6e252e2a0792e.zip |
Add signup and password reset
Diffstat (limited to 'users/migrations')
-rw-r--r-- | users/migrations/0004_passwordreset.py | 60 |
1 files changed, 60 insertions, 0 deletions
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, + }, + ), + ] |