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
Credential/training screwy handling of SYSTEM_MAINTENANCE_NO_UPLOAD #2220
Comments
Anyway, it would probably be useful to have an option to allow new uploads of training applications without allowing changes to project files. |
Also note the PAUSE_CREDENTIALING variable, which is somewhat related though intended for a different purpose. PAUSE_CREDENTIALING causes the link to the credentialing form to be hidden - it doesn't prevent submitting the form. (This is a good thing IMHO; it may have been intentional.) Perhaps PAUSE_CREDENTIALING should also cause the training submission form to be hidden. Another issue is that "no changes" mode should probably imply "no uploads". Maybe "no changes" should also imply "pause credentialing" (or maybe not.) |
Okay, so I had the thought that it might be better to add the behavior to So basically I did this
and that seems to work, maybe? But then:
Not clear if this is some screwiness in Django testing that I need to work around, or if it's some inherent screwiness about database transactions that I don't understand. (Shouldn't the failed transaction be dead and gone at this point?) But surely, rendering the 500 page ought to work even if the database goes completely pear-shaped, right?! Why is the template renderer poking the database at all? On top of all that, it's not obvious to me whether |
It seems to work the way I want if I wrap the body of edit_training in transaction.atomic, or if I wrap TrainingForm.save in transaction.atomic, or even if I just wrap training.save in transaction.atomic. I'm going with "autocommit is inherently screwy". TrainingForm.save should be atomic anyway. Still, if raising an exception during an autocommitted thingy can cause breakage outside the scope of the current requuest, that's a problem. And storage backends raising exceptions when you try to save a file is a Thing That Happens. And our error pages shouldn't be hitting the database. |
Remove some useless junk code that somebody copied and pasted without thinking. The "edit_certifications" page is not the place where you submit training applications. That's the "edit_trainings" page. (related to issue #2220)
credential_application
raises ServiceUnavailable if SYSTEM_MAINTENANCE_NO_UPLOAD is set. I think this is wrong because I think this form does not upload files anymore.On the other hand,
edit_trainings
does not pay attention to SYSTEM_MAINTENANCE_NO_UPLOAD. This is broken and dangerous.See also issue #2051
The text was updated successfully, but these errors were encountered: