Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending Device Model produces error on Registration #27

Open
renzosunico opened this issue Nov 21, 2016 · 2 comments
Open

Extending Device Model produces error on Registration #27

renzosunico opened this issue Nov 21, 2016 · 2 comments

Comments

@renzosunico
Copy link

I can no longer use the registration url after extending device model since I have a non nullable user field.

@Chitrank-Dixit
Copy link
Owner

Hello @renzosunico , sorry for very late reply , is this error coming in the new django-fcm 0.1.1 version ?

@jwjimmy
Copy link
Contributor

jwjimmy commented Mar 19, 2017

I have this same issue on 0.1.1. It looks like the root cause is that when you modify the Device model, the fields of the corresponding DeviceSerializer stay the same.

A quick fix would be to make a change in https://github.com/Chitrank-Dixit/django-fcm/blob/master/fcm/serializers.py#L9

fields = ('dev_id', 'reg_id', 'name', 'is_active')

to

fields = '__all__'

and https://github.com/Chitrank-Dixit/django-fcm/blob/master/fcm/admin.py#L14

list_display = ['dev_id', 'name', 'is_active']

to

list_display = [f.name for f in Device._meta.fields if f.name != "id" if f.name != "reg_id"]

I have these changes ready in a PR I will add to this repo if you'd like to add me as a collaborator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants