deme
deme copied to clipboard
Subscribe does not check for preexistence
I filled in the form to Deme Dev Discussion folio, and it only told me afterward that the subscription already exists. Interface should tell me in the item viewer when I am subscribed to that item.
This is also true for things like Memberships and CustomUrls.
The quick hacky fix is just to create a viewer for these item types (rather than having ItemViewer automatically do the forms), and when you get to the "create" action, it will check for an existing Subscription/Membership, and edit/reactivate it. The nice general fix is to have the form code in base_viewer.py see if you have permission to revise the existing item (with the conflicting key), and if so, do it automatically.
The issue with just "telling you when you are subscribed to that item" is that you may want to be subscribed with multiple contact methods. Also, you may want to subscribe someone else to the item (as an admin, you may want to subscribe all of the members of your organization to the meeting notes). So it's not easy to always display the right thing here.
I fixed this in a general way in commit 7e4f30. If you submit a form and it finds that something else already exists, it links you to that item (so you can reactivate it), and also has a link to "overwrite it", so you don't have to retype all of the changes you made if you really want it to be an edit.
I still don't have a solution for what the page should display instead of "subscribe" if you're already subscribed with one contactmethod, since people may wish to subscribe with more contactmethods.