Fix Trigger Creation Failed
When we create a trigger, it throws a exception like "Unable to create trigger". The reason is that python-smaugclient has changed the return value of trigger creation. So it needs to update dashboard as well. Change-Id: I683cc699adc89a5cee7da21d081d6d761b22370f Closes-Bug: #1613587
This commit is contained in:
@@ -21,7 +21,6 @@ from horizon import messages
|
|||||||
|
|
||||||
from smaug_dashboard.api import smaug as smaugclient
|
from smaug_dashboard.api import smaug as smaugclient
|
||||||
from smaug_dashboard.triggers import utils
|
from smaug_dashboard.triggers import utils
|
||||||
from smaugclient.v1 import triggers
|
|
||||||
|
|
||||||
|
|
||||||
class CreateTriggerForm(horizon_forms.SelfHandlingForm):
|
class CreateTriggerForm(horizon_forms.SelfHandlingForm):
|
||||||
@@ -73,7 +72,7 @@ class CreateTriggerForm(horizon_forms.SelfHandlingForm):
|
|||||||
data_properties)
|
data_properties)
|
||||||
messages.success(request, _("Trigger created successfully."))
|
messages.success(request, _("Trigger created successfully."))
|
||||||
|
|
||||||
return triggers.Trigger(self, new_trigger)
|
return new_trigger
|
||||||
except Exception:
|
except Exception:
|
||||||
exceptions.handle(request, _('Unable to create trigger.'))
|
exceptions.handle(request, _('Unable to create trigger.'))
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user