Rename add_error methods: Django 1.7 conflict

In Django 1.7, Forms have an add_error() method and our definition
was conflicting with Django's method. Thanks to hertzog@debian.org
for the patch.

Close-bug: #1352919
Change-Id: I1f558cf7f3198a68629738a011e9cae0c3749320
This commit is contained in:
Thomas Goirand 2014-08-05 14:50:06 +08:00
parent d6dfd3817b
commit 04dd1568c1
1 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ class Action(forms.Form):
text += linebreaks(force_unicode(self.help_text))
return safe(text)
def add_error(self, message):
def add_action_error(self, message):
"""Adds an error to the Action's Step based on API issues."""
self.errors[NON_FIELD_ERRORS] = self.error_class([message])
@ -430,9 +430,9 @@ class Step(object):
text += self.action.get_help_text()
return safe(text)
def add_error(self, message):
def add_step_error(self, message):
"""Adds an error to the Step based on API issues."""
self.action.add_error(message)
self.action.add_action_error(message)
def has_required_fields(self):
"""Returns True if action contains any required fields."""
@ -861,4 +861,4 @@ class Workflow(html.HTMLElement):
"""
step = self.get_step(slug)
if step:
step.add_error(message)
step.add_step_error(message)