From c9456667f7a6b2497408fd64c8b97b99740897a2 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 11 Jun 2022 16:09:47 +0530 Subject: [PATCH] feat: add creation time to account confirmation challenge --- ...0005_accountconfirmchallenge_created_at.py | 22 +++++++++++++++++++ accounts/models.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 accounts/migrations/0005_accountconfirmchallenge_created_at.py diff --git a/accounts/migrations/0005_accountconfirmchallenge_created_at.py b/accounts/migrations/0005_accountconfirmchallenge_created_at.py new file mode 100644 index 0000000..0bd9dca --- /dev/null +++ b/accounts/migrations/0005_accountconfirmchallenge_created_at.py @@ -0,0 +1,22 @@ +# Generated by Django 4.0.3 on 2022-06-11 10:38 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0004_accountconfirmchallenge_public_ref_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="accountconfirmchallenge", + name="created_at", + field=models.DateTimeField( + auto_now_add=True, default=django.utils.timezone.now + ), + preserve_default=False, + ), + ] diff --git a/accounts/models.py b/accounts/models.py index afe76fd..041503f 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -30,6 +30,7 @@ class AccountConfirmChallenge(models.Model): default=gen_secret, editable=False, ) + created_at = models.DateTimeField(auto_now_add=True, blank=True) challenge_text = models.CharField( "Challenge text",