Skip to content

Commit

Permalink
Don't use 'instance' argument in rendering form for paginated data. C…
Browse files Browse the repository at this point in the history
…loses #2205.
  • Loading branch information
tomchristie committed Dec 8, 2014
1 parent af3fe5a commit 41bfdc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import django
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import Page
from django.http.multipartparser import parse_header
from django.template import Context, RequestContext, loader, Template
from django.test.client import encode_multipart
Expand Down Expand Up @@ -533,6 +534,8 @@ def get_rendered_html_form(self, data, view, method, request):
serializer = getattr(data, 'serializer', None)
if serializer and not getattr(serializer, 'many', False):
instance = getattr(serializer, 'instance', None)
if isinstance(instance, Page):
instance = None
else:
instance = None

Expand Down Expand Up @@ -591,6 +594,8 @@ def get_raw_data_form(self, data, view, method, request):
serializer = getattr(data, 'serializer', None)
if serializer and not getattr(serializer, 'many', False):
instance = getattr(serializer, 'instance', None)
if isinstance(instance, Page):
instance = None
else:
instance = None

Expand Down

0 comments on commit 41bfdc0

Please sign in to comment.