Merge "Add 'bytes' to image size rejection message"
This commit is contained in:
commit
4c038b0d85
@ -448,7 +448,7 @@ class Controller(controller.BaseController):
|
|||||||
content_type='text/plain')
|
content_type='text/plain')
|
||||||
|
|
||||||
except exception.ImageSizeLimitExceeded, e:
|
except exception.ImageSizeLimitExceeded, e:
|
||||||
msg = _("Denying attempt to upload image larger than %d.")
|
msg = _("Denying attempt to upload image larger than %d bytes.")
|
||||||
self._safe_kill(req, image_id)
|
self._safe_kill(req, image_id)
|
||||||
raise HTTPBadRequest(explanation=msg % CONF.image_size_cap,
|
raise HTTPBadRequest(explanation=msg % CONF.image_size_cap,
|
||||||
request=req, content_type='text/plain')
|
request=req, content_type='text/plain')
|
||||||
@ -849,7 +849,7 @@ class ImageDeserializer(wsgi.JSONRequestDeserializer):
|
|||||||
|
|
||||||
elif image_size > CONF.image_size_cap:
|
elif image_size > CONF.image_size_cap:
|
||||||
max_image_size = CONF.image_size_cap
|
max_image_size = CONF.image_size_cap
|
||||||
msg = _("Denying attempt to upload image larger than %d.")
|
msg = _("Denying attempt to upload image larger than %d bytes.")
|
||||||
LOG.warn(msg % max_image_size)
|
LOG.warn(msg % max_image_size)
|
||||||
raise HTTPBadRequest(explanation=msg % max_image_size,
|
raise HTTPBadRequest(explanation=msg % max_image_size,
|
||||||
request=request)
|
request=request)
|
||||||
|
Loading…
Reference in New Issue
Block a user