Duplicate Upload of File Produces General Error
Bug #366361 reported by
Anthony
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KARL3 |
Fix Released
|
Medium
|
Shane Hathaway |
Bug Description
Submitting a duplicate file to the same folder produces a General KARL Error screen. I will include the page source in the ticket.
Changed in karl3: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Shane, the behavior on this is right, the problem is the handling of the error.
On many content types, we allow duplicates by implicitly adding and increment (e.g. "-1") to the __name__. However, File instances get their __name__ from the uploaded filename, which we aren't to munge.
I suspect the solution is to convert this from a ValueError to a form validation error. That way, when the user uses the Add File form to upload a duplicate, we put them back on that form with a friendly error message.
I realize that the form machinery (as it is) might be new territory for you. So feel free to assign it back to me, and I/ChrisR/Balazs can tackle it.
This probably reveals a flaw in my "pretty error handler." Perhaps it should try to show the exception name and value on "General KARL Error" screens.