fsinfuhh / Bitpoll

A web application for scheduling meetings and general polling.
GNU General Public License v3.0
245 stars 38 forks source link

Can't unwatch a poll under certain conditions #134

Open MarkusNeblung opened 1 year ago

MarkusNeblung commented 1 year ago

I recognized it with following workflow: create a poll with "show complete results" -> watch the poll -> change poll settings to " never show results". Now I get the error message "You are not allowed to watch this poll.", if I try to unwatch the poll.

I see 2 possible solutions: https://github.com/fsinfuhh/Bitpoll/blob/3e429d01a758b0ad7a8c4e18d4fc4d15cc2c7daf/bitpoll/poll/models.py#L122-L129 Change the return False to return self.is_ower(user). This will fix the problem only for the owners. But it's possible that other users have the same problem.

https://github.com/fsinfuhh/Bitpoll/blob/3e429d01a758b0ad7a8c4e18d4fc4d15cc2c7daf/bitpoll/poll/views.py#L323-L341 Rearrange this method so that it only throws the error if the user try to watch the poll. This allows to always unwatch to poll.

Beside that it would be helpful if owners always can watch a poll (they can always see the results, so why not allow them always to watch)