almet / copanier

A minimalist collective buying software.
GNU General Public License v3.0
24 stars 10 forks source link

Fix broken former delivery page when groups have been deleted #168

Closed aurelienshz closed 1 year ago

aurelienshz commented 1 year ago

The bug: when deleting a group, attempting to open the delivery from the "former deliveries" page fails, because it tries to read the group's name, using the id found in the orderer field in the group orders for this delivery. It errors out and raises the following error: 'dict object' has no attribute '<deleted group id>'.

This PR fixes it by displaying the group's id in the table header, instead of its "human-friendly" name.

Open to feedback: should we add "(groupe supprimé)" after the group's id? Should we even show the group's id in the first place?

almet commented 1 year ago

Hi @aurelienshz and thanks for the feedback and fix. I'm accepting it as such because it fixes a bug.

the way groups are handled is suboptimal. I'm not sure how we should do it, but somehow it would be nice to have groups "attached" to a delivery somehow. This is tracked by #38, but requires a "big" refactoring.