Commit d92716d6 by Szabolcs Gelencser

Ensure default lease's role selector doesn't show up

parent 48c95e94
......@@ -16,8 +16,8 @@
{% endwith %}
<form method="post">
{% csrf_token %}
<div class="row">
<div class="col-md-7">
<div class="row container-fluid">
<div {% if not is_default %} class="col-md-7" {% endif %}>
{{ form.name|as_crispy_field }}
<label>Suspend in</label>
<div class="input-group interval-input">
......@@ -42,10 +42,12 @@
<div class="input-group-addon">months</div>
</div>
</div>
{% if not is_default %}
<div class="col-md-5">
{{ form.roles }}
</div>
<div class="form-group container-fluid">
{% endif %}
<div class="form-group">
<div class="controls ">
<input type="submit" name="submit" value="Save changes" class="btn btn-primary" id="submit-id-submit">
</div>
......
......@@ -60,6 +60,7 @@ from .util import (
DeleteViewBase, TransferOwnershipConfirmView, TransferOwnershipView)
logger = logging.getLogger(__name__)
from django.conf import settings
class TemplateChoose(LoginRequiredMixin, TemplateView):
......@@ -433,6 +434,11 @@ class LeaseDetail(LoginRequiredMixin, PolicyMixin,
kwargs['roles'] = keystone.role_list(self.request)
return kwargs
def get_context_data(self, *args, **kwargs):
context = super(LeaseDetail, self).get_context_data(*args, **kwargs)
context['is_default'] = settings.DEFAULT_LEASE_NAME == self.object.name
return context
class LeaseDelete(DeleteViewBase):
model = Lease
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment