I agree with you, generate_filename should just call the field upload_to and then delegate the whole name generation to the storage.
There's another thing about file storage that is troubling me:
https://github.com/django/django/blob/master/django/core/files/storage.py#L57The docs state you are not suposed to override the save method and just implement _save, however, doing a complete random rename at the send pretty much forces you to always override save instead. That name replacement is probably to save the file name in a way you can easily create the URL, but again, that should be delegated to the storage.url method shouldn't it?
There's one more thing I noticed (gonna open a ticket about this one) is that the proxy class for FileField (FieldFile, what a name!) states in the docs that in order to call its save method you need a django File object rather than a simple file-like object, I can understand that's because the save method uses the .size property (
https://github.com/django/django/blob/master/django/db/models/fields/files.py#L92) to save the file size into a _size variable. It doesn't seem anywhere in the code the _size is being used as size is a property that gets the file size either from the storage class or the actual file. So removing that line, could also allow us to use normal files in the save method.