diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-06-19 02:04:37 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-06-19 02:04:37 +0000 |
| commit | 214d88ce86e6257437bf2702ea6ef60e0ae23fad (patch) | |
| tree | 1d7bee258e1657d18ac912971cc9000d05ffb1c4 /django/http | |
| parent | a93b1f7ac34c61ae4aa64423e9e46dc5d5349434 (diff) | |
Fixed #1646 -- Added HttpResponseNotAllowed, as suggested by Ian Holsman.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3144 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index bb03ab8ea5..178510c94c 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -265,6 +265,12 @@ class HttpResponseForbidden(HttpResponse): HttpResponse.__init__(self, *args, **kwargs) self.status_code = 403 +class HttpResponseNotAllowed(HttpResponse): + def __init__(self, permitted_methods): + HttpResponse.__init__(self) + self['Allow'] = ', '.join(permitted_methods) + self.status_code = 405 + class HttpResponseGone(HttpResponse): def __init__(self, *args, **kwargs): HttpResponse.__init__(self, *args, **kwargs) |
