Skip to content

Commit

Permalink
Model defaults ignored on empty boolean field
Browse files Browse the repository at this point in the history
marktucker-django committed Oct 20, 2015
1 parent bb01640 commit 4c4641f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions push_notifications/api/rest_framework.py
Original file line number Diff line number Diff line change
@@ -39,6 +39,9 @@ class Meta:
fields = ("name", "registration_id", "device_id", "active", "date_created")
read_only_fields = ("date_created", )

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


class APNSDeviceSerializer(ModelSerializer):

0 comments on commit 4c4641f

Please sign in to comment.