platform-coop-toolkit / coop-map-directory-index

The Map/Directory/Index component of the Platform Cooperative Development Kit.
https://directory.platform.coop
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Socialnetworks linger after an individual profile is deleted #103

Closed erictheise closed 4 years ago

erictheise commented 4 years ago

Describe the bug

I deleted an individual profile. I created a new one with a different Socialnetwork. The socialnetworks associated with the earlier profile still showed on the profile page along with the new one.

To Reproduce

Steps to reproduce the behavior:

  1. Create an individual profile having certain socialnetwork values
  2. Delete that individual profile
  3. Create a new individual profile having different socialnetwork values
  4. See socialnetworks from deleted profile in current profile

Expected behavior

Clean slate!

Additional Context

Evaluate the CASCADE rules in the database models.

erictheise commented 4 years ago

Uncovered in the course of reviewing #84. Seems unlikely to have been introduced with that PR.

greatislander commented 4 years ago

@erictheise I believe this issue was introduced by #97. As I discussed in #127, "deleting" an individual profile doesn't currently do anything except for setting has_profile to False. I'm going to resolve this issue and #127 in a forthcoming pull request which will change that behaviour so that after you delete your profile from the "My profiles" page "the only individual data left in the system is my email address and password, the bare minimum to keep an account functioning" (https://github.com/platform-coop-toolkit/coop-map-directory-index/issues/127#issuecomment-653630050).

I tried creating a profile from the admin and the shell, adding a social networks to both, and deleting both, and the social networks disappeared in both instances, so I think this is a bug in #97 specifically.