Skip to content

Commit 714b46b

Browse files
committed
Change created_at auto_now to auto_now_add (#2378)
1 parent e81b2a4 commit 714b46b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.16 on 2025-01-07 06:30
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("local_units", "0019_localunit_last_sent_validator_type"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="localunit",
15+
name="created_at",
16+
field=models.DateTimeField(auto_now_add=True, verbose_name="Created at"),
17+
),
18+
]

local_units/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class DeprecateReason(models.IntegerChoices):
307307
)
308308
local_branch_name = models.CharField(max_length=255, null=True, blank=True, verbose_name=_("Branch name in local language"))
309309
english_branch_name = models.CharField(max_length=255, null=True, blank=True, verbose_name=_("Branch name in English"))
310-
created_at = models.DateTimeField(verbose_name=_("Created at"), auto_now=True)
310+
created_at = models.DateTimeField(verbose_name=_("Created at"), auto_now_add=True)
311311
modified_at = models.DateTimeField(verbose_name=_("Modified at"), auto_now=True)
312312
created_by = models.ForeignKey(
313313
settings.AUTH_USER_MODEL,

0 commit comments

Comments
 (0)