diff --git a/backend/donations/migrations/0004_alter_donor_date_created_alter_ngo_date_created.py b/backend/donations/migrations/0004_alter_donor_date_created_alter_ngo_date_created.py new file mode 100644 index 00000000..d9565dc6 --- /dev/null +++ b/backend/donations/migrations/0004_alter_donor_date_created_alter_ngo_date_created.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.10 on 2024-02-20 10:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("donations", "0003_alter_ngo_name_alter_ngo_slug"), + ] + + operations = [ + migrations.AlterField( + model_name="donor", + name="date_created", + field=models.DateTimeField(db_index=True, verbose_name="date created"), + ), + migrations.AlterField( + model_name="ngo", + name="date_created", + field=models.DateTimeField(db_index=True, verbose_name="date created"), + ), + ] diff --git a/backend/donations/models/main.py b/backend/donations/models/main.py index 5e92efa0..35f446f8 100644 --- a/backend/donations/models/main.py +++ b/backend/donations/models/main.py @@ -178,7 +178,7 @@ class Ngo(models.Model): upload_to=partial(year_ngo_directory_path, "ngo-forms"), ) - date_created = models.DateTimeField(verbose_name=_("date created"), db_index=True, auto_now_add=timezone.now) + date_created = models.DateTimeField(verbose_name=_("date created"), db_index=True) date_updated = models.DateTimeField(verbose_name=_("date updated"), db_index=True, auto_now=timezone.now) objects = models.Manager() @@ -275,7 +275,7 @@ class Donor(models.Model): upload_to=partial(year_ngo_donor_directory_path, "donation-forms"), ) - date_created = models.DateTimeField(verbose_name=_("date created"), db_index=True, auto_now_add=timezone.now) + date_created = models.DateTimeField(verbose_name=_("date created"), db_index=True) class Meta: verbose_name = _("donor") diff --git a/backend/users/migrations/0003_alter_user_date_created.py b/backend/users/migrations/0003_alter_user_date_created.py new file mode 100644 index 00000000..131a93a1 --- /dev/null +++ b/backend/users/migrations/0003_alter_user_date_created.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.10 on 2024-02-20 10:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0002_user_date_created_user_date_updated_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="date_created", + field=models.DateTimeField(verbose_name="date created"), + ), + ] diff --git a/backend/users/models.py b/backend/users/models.py index d6d9eea7..94a918e5 100644 --- a/backend/users/models.py +++ b/backend/users/models.py @@ -83,7 +83,7 @@ class User(AbstractUser): old_password = models.CharField(verbose_name=_("old password"), max_length=128, blank=True, null=True) - date_created = models.DateTimeField(verbose_name=_("date created"), auto_now_add=timezone.now, db_index=True) + date_created = models.DateTimeField(verbose_name=_("date created")) date_updated = models.DateTimeField(verbose_name=_("date updated"), auto_now=timezone.now, db_index=True) objects = CustomUserManager()