We have a model that uses an imagefield.ImageField and memcached as backend.
If this model is:
edited in the admin
and another field of the model leads to a validation error
and the name of the imagefield includes a space (or any character that is not allowed as memcached-key)
The form should be rendered again with the errors, but the ImageField tries to get a value from the cache with the invalid key, which leads to a MemcachedKeyCharacterError. This happens because the file name has not been cleaned by django, since the model wasn't saved because of the validation error.
We have a model that uses an
imagefield.ImageField
and memcached as backend. If this model is:The form should be rendered again with the errors, but the
ImageField
tries to get a value from the cache with the invalid key, which leads to aMemcachedKeyCharacterError
. This happens because the file name has not been cleaned by django, since the model wasn't saved because of the validation error.In
imagefield/fields.py
Fix would probably be to catch the exception, or any exception that could come from fetching a value from the cache, and continue with an empty url.