1
0
mirror of https://github.com/django/django.git synced 2024-12-22 09:05:43 +00:00

Removed default empty content argument from HttpResponse calls.

This commit is contained in:
Jon Dufresne 2019-02-09 13:27:32 -08:00 committed by Tim Graham
parent 959d0c078a
commit c492fdfd24
9 changed files with 15 additions and 15 deletions

View File

@ -118,7 +118,7 @@ And the view::
def head(self, *args, **kwargs):
last_book = self.get_queryset().latest('publication_date')
response = HttpResponse('')
response = HttpResponse()
# RFC 1123 date format
response['Last-Modified'] = last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT')
return response

View File

@ -20,7 +20,7 @@ def file_upload_view(request):
# not the full path.
if os.path.dirname(form_data['file_field'].name) != '':
return HttpResponseServerError()
return HttpResponse('')
return HttpResponse()
else:
return HttpResponseServerError()
@ -50,7 +50,7 @@ def file_upload_view_verify(request):
obj = FileModel()
obj.testfile.save(largefile.name, largefile)
return HttpResponse('')
return HttpResponse()
def file_upload_unicode_name(request):
@ -79,7 +79,7 @@ def file_upload_unicode_name(request):
if response:
return response
else:
return HttpResponse('')
return HttpResponse()
def file_upload_echo(request):
@ -157,4 +157,4 @@ def file_upload_content_type_extra(request):
def file_upload_fd_closing(request, access):
if access == 't':
request.FILES # Trigger file parsing.
return HttpResponse('')
return HttpResponse()

View File

@ -2,4 +2,4 @@ from django.http import HttpResponse
def empty_view(request, *args, **kwargs):
return HttpResponse('')
return HttpResponse()

View File

@ -2,4 +2,4 @@ from django.http import HttpResponse
def empty_view(request, *args, **kwargs):
return HttpResponse('')
return HttpResponse()

View File

@ -22,7 +22,7 @@ def model_view(request):
def create_model_instance(request):
person = Person(name='emily')
person.save()
return HttpResponse('')
return HttpResponse()
def environ_view(request):

View File

@ -21,7 +21,7 @@ def no_template_view(request):
def staff_only_view(request):
"A view that can only be visited by staff. Non staff members get an exception"
if request.user.is_staff:
return HttpResponse('')
return HttpResponse()
else:
raise CustomTestException()

View File

@ -16,4 +16,4 @@ def no_template_used(request):
def empty_response(request):
return HttpResponse('')
return HttpResponse()

View File

@ -2,4 +2,4 @@ from django.http import HttpResponse
def empty_view(request, *args, **kwargs):
return HttpResponse('')
return HttpResponse()

View File

@ -7,11 +7,11 @@ from django.views.generic import RedirectView
def empty_view(request, *args, **kwargs):
return HttpResponse('')
return HttpResponse()
def absolute_kwargs_view(request, arg1=1, arg2=2):
return HttpResponse('')
return HttpResponse()
def defaults_view(request, arg1, arg2):
@ -27,7 +27,7 @@ def erroneous_view(request):
def pass_resolver_match_view(request, *args, **kwargs):
response = HttpResponse('')
response = HttpResponse()
response.resolver_match = request.resolver_match
return response
@ -37,7 +37,7 @@ uncallable = None # neither a callable nor a string
class ViewClass:
def __call__(self, request, *args, **kwargs):
return HttpResponse('')
return HttpResponse()
view_class_instance = ViewClass()