renlok / weightroom.uk

Text based workout tracker
https://weightroom.uk
MIT License
5 stars 4 forks source link

Editing name to same name deletes exercise id #80

Closed kevinguebert closed 1 year ago

kevinguebert commented 4 years ago

Description

If a user goes in to edit an exercise name but changes it to be the same name as the old one, that will delete the exercise and cause errors throughout the logs/site.

I ran into this as I did not know how the capitalization worked on the site. I wanted "Ohp" to actually be "OHP" (all caps, I know, not that important but just for looks). So, I tried to edit the exercise but in doing so, this actually deleted all Ohp exercises

How to

  1. Create a log with:
    #ohp
    5x5x5
  2. Save log
  3. View exercise
  4. Edit exercise
  5. Try and rename "Ohp" to "OHP"
renlok commented 4 years ago

Hey so I think this was supposed to work as a way to merge exercises by deleting the second exercise and changing all references to it to point to the new exercise. Where were you getting the errors when you did this, or was it really just site breakingly bad?