Renewals not processed correctly on uniqueness constraint for membership id

One-sentence description

Renewals not processed correctly on uniqueness constraint for membership id

Current behaviour / Reproducing the bug

  1. Do a renewal for 1 year
  2. Approve it, add a payment, finish it fully etc
  3. Do a renewal for the rest of your study
  4. Approve it
  5. Process a payment
  6. Breakage

(the payment gets processed, the membership is correctly added to the user, but the renewal does stick at 'approved' (with a processed payment attached))

Expected behaviour

Do not crash

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information