aboutsummaryrefslogtreecommitdiffstats
path: root/flywheel/emitters.py
diff options
context:
space:
mode:
Diffstat (limited to 'flywheel/emitters.py')
-rw-r--r--flywheel/emitters.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/flywheel/emitters.py b/flywheel/emitters.py
index d052d965..57e95ec2 100644
--- a/flywheel/emitters.py
+++ b/flywheel/emitters.py
@@ -32,6 +32,8 @@ class BaseEmitter(object):
self.resource = resource
def emit(self, output=NoContent, verbose=False):
+ """By default emit simply returns the ouput as-is.
+ Override this method to provide for other behaviour."""
if output is NoContent:
return ''
@@ -81,7 +83,8 @@ class DocumentingTemplateEmitter(BaseEmitter):
provide a form that can be used to submit arbitrary content."""
# Get the form instance if we have one bound to the input
form_instance = resource.form_instance
-
+ print form_instance
+
# Otherwise if this isn't an error response
# then attempt to get a form bound to the response object
if not form_instance and resource.response.has_content_body:
@@ -89,6 +92,8 @@ class DocumentingTemplateEmitter(BaseEmitter):
form_instance = resource.get_form(resource.response.raw_content)
except:
pass
+ if form_instance and not form_instance.is_valid():
+ form_instance = None
# If we still don't have a form instance then try to get an unbound form
if not form_instance: