fix project quota showing error and success message

right now if you try to change a quota value to something less than what is currently
used, it will give you both error and success message
fix test cases to check for 2 errors messages

Change-Id: I25550346e553b1469b321cd46b2eeff612f11869
Closes-Bug: #1278353
This commit is contained in:
Cindy Lu 2014-02-17 18:59:51 -08:00
parent 3cc174624e
commit b615a4e70d
2 changed files with 5 additions and 5 deletions

View File

@ -1293,7 +1293,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res)
self.assertMessageCount(error=1, warning=0)
self.assertMessageCount(error=2, warning=0)
self.assertRedirectsNoFollow(res, INDEX_URL)
@test.create_stubs({api.keystone: ('tenant_get',
@ -1414,7 +1414,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res)
self.assertMessageCount(error=1, warning=0)
self.assertMessageCount(error=2, warning=0)
self.assertRedirectsNoFollow(res, INDEX_URL)
@test.create_stubs({api.keystone: ('get_default_role',

View File

@ -632,7 +632,7 @@ class UpdateProject(workflows.Workflow):
'update project quotas.')
% {'users_to_modify': users_to_modify,
'group_msg': group_msg})
return True
return False
if PROJECT_GROUP_ENABLED:
# update project groups
@ -703,7 +703,7 @@ class UpdateProject(workflows.Workflow):
'members, update project groups '
'and update project quotas.'
% groups_to_modify))
return True
return False
# update the project quota
nova_data = dict(
@ -732,4 +732,4 @@ class UpdateProject(workflows.Workflow):
exceptions.handle(request, _('Modified project information and '
'members, but unable to modify '
'project quotas.'))
return True
return False