Olen / Spond

GNU General Public License v3.0
45 stars 23 forks source link

`Spond.update_events(uid...)` will modify or overwrite another event, if no event matching uid exists #160

Closed elliot-100 closed 1 month ago

elliot-100 commented 1 month ago

Extracting specific bug from PR #134:

...a bug in update_events: the loop in https://github.com/Olen/Spond/blob/bcb2b6d6558dd6782c2e5ed544bd7d3c214c16d0/spond/spond.py#L332-L334 will fall through, if no event matching uid exists, and proceed to modify or overwrite whatever event was last in the loop.

Refactoring the code to use self._get_entity(self._EVENT, uid) should ensure an error is raised when the uid is not matched, and prevent any event modification.

elliot-100 commented 1 month ago

Fixed by PR #161