Skip to content

Commit

Permalink
updated forms.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dkdndes committed Jan 30, 2015
1 parent 70b89dd commit 5a829bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webservicedoc/forms.py
Expand Up @@ -6,7 +6,7 @@

# Utilities
import pyxb # For catching the exceptions
import dwml # The Python-version WADL XSD validator
import wadl # The Python-version WADL XSD validator


class WebservicedocAdminForm(forms.ModelForm):
Expand All @@ -16,13 +16,13 @@ class WebservicedocAdminForm(forms.ModelForm):
class Meta:
model = Webservicedoc

def clean_dwml_raw(self):
def clean_wadl_raw(self):
# Custom WADL validation
dwml_raw = self.cleaned_data['dwml_raw']
wadl_raw = self.cleaned_data['wadl_raw']
try:
this_dwml = dwml.CreateFromDocument(dwml_raw)
this_wadl = wadl.CreateFromDocument(wadl_raw)
except pyxb.UnrecognizedContentError as e:
raise forms.ValidationError("Error validating response: %s" % e.details())
except Exception, e:
raise forms.ValidationError("Unknown validation error: %s" % e)
return dwml_raw
return wadl_raw

0 comments on commit 5a829bb

Please sign in to comment.