diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-06-30 21:25:16 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-06-30 21:27:47 +0200 |
| commit | da200c5e35cdbb617572977bcbf97fae33920b2e (patch) | |
| tree | 07c028161c8975172b995aaf8beceec7649e7ef0 /django/http | |
| parent | deed192dda621f1cdc8eb7240f1e5914045402dd (diff) | |
Fixed #16519 -- Deprecated mimetype kwarg of HttpResponse __init__
This keyword was already deprecated in the code (supported for
backwards compatibility only), but never formally deprecated.
Thanks Paul McMillan for the report and yasar11732 for the initial
patch.
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 30d7e5dc2f..51e6ca2304 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -524,14 +524,16 @@ class HttpResponse(object): status_code = 200 - def __init__(self, content='', mimetype=None, status=None, - content_type=None): + def __init__(self, content='', content_type=None, status=None, + mimetype=None): # _headers is a mapping of the lower-case name to the original case of # the header (required for working with legacy systems) and the header # value. Both the name of the header and its value are ASCII strings. self._headers = {} self._charset = settings.DEFAULT_CHARSET - if mimetype: # For backwards compatibility. + if mimetype: + warnings.warn("Using mimetype keyword argument is deprecated, use" + " content_type instead", PendingDeprecationWarning) content_type = mimetype if not content_type: content_type = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE, |
