Ignore irrelevant secgroup form field errors

When cleaning data from in the security group rule form, remove any
associated error messages that are not related to the actual fields
being saved.  If we are setting a value derived from another field, also
delete the error message associated with that field.

Change-Id: I1eb4835ea2368b62374f230c6293062a2340980d
Closes-Bug:1237128
This commit is contained in:
Russell Sim 2013-10-09 12:54:41 +11:00
parent 5eaa0d1e12
commit 03e516fa6b
1 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ def create_stubs(stubs_to_create={}):
def inner_stub_out(fn):
@wraps(fn)
def instance_stub_out(self):
def instance_stub_out(self, *args, **kwargs):
for key in stubs_to_create:
if not (isinstance(stubs_to_create[key], tuple) or
isinstance(stubs_to_create[key], list)):
@ -80,7 +80,7 @@ def create_stubs(stubs_to_create={}):
for value in stubs_to_create[key]:
self.mox.StubOutWithMock(key, value)
return fn(self)
return fn(self, *args, **kwargs)
return instance_stub_out
return inner_stub_out