Skip to content

Commit 4c4641f

Browse files
author
marktucker-django
committed
Model defaults ignored on empty boolean field
See encode/django-rest-framework#1101
1 parent bb01640 commit 4c4641f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

push_notifications/api/rest_framework.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class Meta:
3939
fields = ("name", "registration_id", "device_id", "active", "date_created")
4040
read_only_fields = ("date_created", )
4141

42+
# See https://github.com/tomchristie/django-rest-framework/issues/1101
43+
extra_kwargs = {"active": {"default": True}}
44+
4245

4346
class APNSDeviceSerializer(ModelSerializer):
4447

0 commit comments

Comments
 (0)