DH-IT-Portal-Development / ethics

Ethical Committee web application in Django
http://fetc.hum.uu.nl
MIT License
2 stars 1 forks source link

'applicants' cannot be None, when 'other_applicants' is False #645

Open EdoStorm96 opened 6 months ago

EdoStorm96 commented 6 months ago

This is a bit of a weird bug. Not a huge deal, but not ideal. So when you remove all users from applicants and then set other_applicants to False, which is kind off intuitive, if you want to set other_applicants to False, you cause a bug. You cannot continue with the proposal by clicking save & continue. It won´t show an error message to indicate what is going on, because that is hidden. Normally, applicants will always contain at least the user, as that is provided as an initial value in ProposalCreate.get_initial(). If you try to navigate with the stepper, when this occurs, you also crash the form´s clean().

tymees commented 6 months ago

The actual bug here is the creator not being forcibly added to applicants. (Or, that happening only after validation). The creator MUST AND SHALL always be listed in applicants. The portal will break in weird ways if that's not the case.

The form is (mostly) doing what it should to enforce that.

(Hell, I'd even say we should patch Proposal.save() to enforce this constraint, seeing how important it is).