{"action":"created","issue":{"url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/270","labels_url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/270/comments","events_url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/270/events","html_url":"https://github.com/jleclanche/django-push-notifications/issues/270","id":126425995,"number":270,"title":"registration_id unique constraint fails on PUT (Update)","user":{"login":"mr-const","id":2544447,"avatar_url":"https://avatars.githubusercontent.com/u/2544447?v=3","gravatar_id":"","url":"https://api.github.com/users/mr-const","html_url":"https://github.com/mr-const","followers_url":"https://api.github.com/users/mr-const/followers","following_url":"https://api.github.com/users/mr-const/following{/other_user}","gists_url":"https://api.github.com/users/mr-const/gists{/gist_id}","starred_url":"https://api.github.com/users/mr-const/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mr-const/subscriptions","organizations_url":"https://api.github.com/users/mr-const/orgs","repos_url":"https://api.github.com/users/mr-const/repos","events_url":"https://api.github.com/users/mr-const/events{/privacy}","received_events_url":"https://api.github.com/users/mr-const/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T14:13:28Z","updated_at":"2016-01-15T04:57:09Z","closed_at":null,"body":"We use GCMDeviceSerializer as nested serializer\r\n```python\r\nclass DataSerializer(serializers.ModelSerializer):\r\n    gcm_device = GCMDeviceSerializer(allow_null=True, required=False)\r\n```\r\nand it always fails validation when we try to update our Data object with message: `{\"gcm_device\":{\"registration_id\":[\"This field must be unique.\"]}}`\r\n\r\nIt seems that following code executes on both create and update calls:\r\n```python\r\n\t\t\t# Work around an issue with validating the uniqueness of\r\n\t\t\t# registration ids of up to 4k\r\n\t\t\t'registration_id': {\r\n\t\t\t\t'validators': [\r\n\t\t\t\t\tUniqueValidator(queryset=GCMDevice.objects.all())\r\n\t\t\t\t]\r\n\t\t\t}\r\n```"},"comment":{"url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/comments/171872094","html_url":"https://github.com/jleclanche/django-push-notifications/issues/270#issuecomment-171872094","issue_url":"https://api.github.com/repos/jleclanche/django-push-notifications/issues/270","id":171872094,"user":{"login":"jamaalscarlett","id":7093153,"avatar_url":"https://avatars.githubusercontent.com/u/7093153?v=3","gravatar_id":"","url":"https://api.github.com/users/jamaalscarlett","html_url":"https://github.com/jamaalscarlett","followers_url":"https://api.github.com/users/jamaalscarlett/followers","following_url":"https://api.github.com/users/jamaalscarlett/following{/other_user}","gists_url":"https://api.github.com/users/jamaalscarlett/gists{/gist_id}","starred_url":"https://api.github.com/users/jamaalscarlett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamaalscarlett/subscriptions","organizations_url":"https://api.github.com/users/jamaalscarlett/orgs","repos_url":"https://api.github.com/users/jamaalscarlett/repos","events_url":"https://api.github.com/users/jamaalscarlett/events{/privacy}","received_events_url":"https://api.github.com/users/jamaalscarlett/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T04:57:09Z","updated_at":"2016-01-15T04:57:09Z","body":"This appears to be a known issue with writable nested serializers https://github.com/tomchristie/django-rest-framework/issues/2403"}}