Comment 2 for bug 366361

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

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.