Forbid form closing on the backdrop click
Change-Id: Ifb11c585dbb37940bfb6d91ca6279f73e67a93ce
This commit is contained in:
parent
d8da643403
commit
0586c6ec9a
|
@ -176,8 +176,6 @@ def environments_list(request):
|
|||
def environment_create(request, parameters):
|
||||
#name is required param
|
||||
name = parameters['name']
|
||||
log.debug('Environment::Create <Name: {0}>'.format(name))
|
||||
|
||||
env = muranoclient(request).environments.create(name)
|
||||
log.debug('Environment::Create {0}'.format(env))
|
||||
return env
|
||||
|
|
|
@ -23,7 +23,7 @@ from horizon import workflows
|
|||
from muranodashboard.panel import api
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SelectProjectUserAction(workflows.Action):
|
||||
|
@ -87,7 +87,9 @@ class CreateEnvironment(workflows.Workflow):
|
|||
try:
|
||||
api.environment_create(request, context)
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
name = self.context.get('name', 'noname')
|
||||
log.error("Unable to create environment {0}".format(name))
|
||||
exceptions.handle(request)
|
||||
return False
|
||||
|
||||
|
@ -100,9 +102,11 @@ class UpdateEnvironmentInfoAction(workflows.Action):
|
|||
api.environment_update(request,
|
||||
data['environment_id'],
|
||||
data['name'])
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
exceptions.handle(request, ignore=True)
|
||||
log.error("Unable to update environment name with ud={0}".format(
|
||||
data['environment_id'],
|
||||
))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<div id="{% block modal_id %}{% endblock %}" data-backdrop="static" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
|
||||
<div class="modal-header">
|
||||
{% if hide %}<a href="#" class="close" data-dismiss="modal">×</a>{% endif %}
|
||||
<h3>{% block modal-header %}{% endblock %}</h3>
|
||||
</div>
|
||||
{% if table %}
|
||||
<div class="modal-body">
|
||||
{{ table.render }}
|
||||
</div>
|
||||
<hr />
|
||||
{% endif %}
|
||||
<form id="{% block form_id %}{% endblock %}" autocomplete="{% block autocomplete %}{% endblock %}" class="{% block form_class %}{% endblock %}" action="{% block form_action %}{% endblock %}" method="{% block form-method %}POST{% endblock %}" {% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
|
||||
<div class="modal-body clearfix">
|
||||
{% block modal-body %}
|
||||
<fieldset>
|
||||
{% include "horizon/common/_form_fields.html" %}
|
||||
</fieldset>
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
|
||||
</form>
|
||||
</div>
|
|
@ -16,7 +16,7 @@
|
|||
{% endfor %}
|
||||
{% else %}
|
||||
<fieldset>
|
||||
{% include "services/_horizon_form_fields.html" %}
|
||||
{% include "common/_form_fields.html" %}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue