-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Issues/412 ability to clear sections/instance web/api #522
base: master
Are you sure you want to change the base?
Fixed Issues/412 ability to clear sections/instance web/api #522
Conversation
Thanks for looking at this! Just to note that an easier way to go than a signal might be to change the However, I'm not sure if we want to make this always happen – I think it would be possible that someone would want to delete a section but keep all the speeches in it (perhaps they had them in a section, but then changed their mind and wanted to remove the section without having to update every speech). I think it would be good if the web interface would let you, when you are confirming the delete, also say whether you want to delete all the associated speeches – that way, people can pick what they wish to do. If that's something you could look at adding, that'd be great :) You'd need to expand |
Hi @dracos! Would it be sensible to treat that ask as a value-add? Seems that the deletes are already cascading, so this just adds an easier UI. If @billy3321 has become busy and you're still interested, I could re-test this feature, adding a confirmation message with warning if it's not there. Then I could open another issue to making it optional via the UI :) Would that be satisfactory? Y'all are awesome regardless! |
Hi, @dracos, @patcon, thanks for your advice! I use sayit often, and sometimes when I import a wrong an file, it appear wrong section with a lot of speeches. If I delete the section, it leaves a lot of orphan speeches, and I have no way to delete it all. so I send this pull request, avoid another user have this problem. In before, I didn't have experience about Django, and I had read the manual about the But, the pull request have some problem about the test, it seems not cause by the code I modified. I don't know how to fix it. May you help me to fix the test? Thank you. |
@billy3321 Thanks! The flake8 test failures aren't related to your changes, no, and I'll try and look at them soon, but the actual test failure is – it is testing that a speech is not deleted when a section is, which your code changes. So you would need to update the test in @patcon The section delete does not at present cascade to its speeches, meaning currently you can delete a section without deleting its speeches. As you could delete all the speeches of a section programmatically by deleting each speech individually and then the section (not ideal but possible), the issue I mentioned with this PR is that it would remove that possibility – removing a section would always remove the speeches, even if you didn't want to do that (well, you could programmatically remove the section from each speech first instead). However, as two people have asked for this and actively want it, it would make no sense to just let this languish and annoy you both/put you off! So I'd be happy to go with this for now, and hopefully address making it optional as with @patcon's suggestion later. What @billy3321 did originally with some code in a signal would presumably actually make that easier (because then in future that code could be called optionally rather than a forced CASCADE on the model). So sorry about that diversion, and hope what I've said makes sense. I will try and fix the flake8 issue on this branch soon. |
@dracos Aaaaaand you are wonderful. Let me know if I can help @billy3321 |
b84d271
to
89952e6
Compare
Fixed the issue #412