Skip to content

Commit 2ec823a

Browse files
authored
Merge pull request xtrinch#100 from AlexisCaffa/patch-1
KeyError bug fixed when update
2 parents 82f21c6 + 3a62f8a commit 2ec823a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fcm_django/api/rest_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def validate(self, attrs):
6464
devices = Device.objects.filter(
6565
registration_id=attrs["registration_id"]) \
6666
.exclude(id=primary_key)
67-
if (attrs["active"]):
67+
if (attrs.get('active', False)):
6868
devices.filter(~Q(user=user)).update(active=False)
6969
devices = devices.filter(user=user)
7070
else:

0 commit comments

Comments
 (0)