-
-
Notifications
You must be signed in to change notification settings - Fork 631
Update Device.user when updating existing devices via DRF. #269
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
Conversation
@salian This looks fine, although there is an inherent flaw in the un-authenticated viewset. Currently, anyone can edit any object. All that is needed is the registration_id, once that is know any of the serializer fields can modified. |
@jamaalscarlett I agree, especially in combination with an un-authenticated endpoint for exposing a list of all devices via GET. It takes away whatever little security via obscurity there is. |
@salian I would be more comfortable if there was a check for an existing user. To prevent the current user for being overwritten, I would only save the user if the current user is None. |
I think the desired behaviour is to overwrite the Moreover GCM will issue the same registration id again unless a user uninstalls and reinstalls the app, so there is no way for the calling app to come up with a different |
@salian I forgot about the validator. This is why a wrote my own DRF integration. Could you please squash these commits. After that, this is good to merge. |
@salian can you clean up the commit so we can get this merged in? |
@jleclanche any thoughts on this one? |
@jamaalscarlett I actually can't figure how to clean it via the web interface, and I am not familiar with the CLI. Should I delete this and make a fresh branch? |
@salian From the command line run git rebase -i HEAD~3 and follow the instructions. |
@salian any luck? I can fix it if you still can't figure it out. |
@jamaalscarlett gtm; you can rebase & land. sorry this went under the radar. |
Addresses issue #268
Overrides
perform_update
(similar toperform_create
) to update Device.user when updating existing devices.