open-humans icon indicating copy to clipboard operation
open-humans copied to clipboard

Updating project.name does not update project.application.name

Open madprime opened this issue 6 years ago • 2 comments

For an OAuth2DataRequestProject in private_sharing.models, it is possible to update the name field via UpdateOAuth2DataRequestProjectView in private_sharing.views (i.e. the value of project.name).

However, this update fails to update the name in the associated application (i.e. the value of project.application.name). This isn't reflected anywhere for users, but (depending on the name updates) it could be quite confusing for administrators as they (for example) examine token ownership, and the apps and projects associated to them.

In addition to fixing the behavior of this view, existing projects should have their associated applications updated to match project names.

madprime avatar May 02 '18 02:05 madprime

To clarify, I think I know what happened: although OAuth2DataRequestProject overrides the save() method to map this to the related application, I modified the name on the parent model, a DataRequestProject, and so the name update didn't happen.

The fix is maybe to override the save() for DataRequestProject as well and perform that mapping, if the DataRequestProject has an associated oauth2datarequestproject.

madprime avatar May 08 '18 17:05 madprime

This is arguably in "wontfix" territory: it will only happen if an admin tries to change an OAuth2 project name by editing the DataRequestProject parent model, rather than the OAuth2DataRequestProject.

madprime avatar Sep 13 '18 20:09 madprime