Skip to content

Commit 09ad91e

Browse files
committed
Fixed model checks.
1 parent abe7267 commit 09ad91e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Migration(migrations.Migration):
4343
"active",
4444
models.NullBooleanField(),
4545
)
46-
if django.VERSION < (3, 2)
46+
if django.VERSION < (2, 1)
4747
else (
4848
"active",
4949
models.BooleanField(null=True),

models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import django
12
from django.db import models
23
from django.utils.translation import gettext_lazy as _
34

@@ -7,7 +8,11 @@ class TestModel(models.Model):
78
update_at = models.DateTimeField(auto_now=True)
89
name = models.CharField(max_length=500)
910
age = models.PositiveIntegerField(default=50)
10-
active = models.BooleanField(null=True)
11+
12+
if django.VERSION < (2, 1):
13+
active = models.NullBooleanField()
14+
else:
15+
active = models.BooleanField(null=True)
1116

1217
class Meta:
1318
verbose_name = _("test model")

0 commit comments

Comments
 (0)