Only show warning if no mnt present on domains

This commit is contained in:
Sebastian Lohff 2017-03-27 02:15:26 +02:00
parent e701b4be7f
commit 246032f03e
2 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,7 @@ def overview(request):
nameservers = Nameserver.objects.filter(mnt_by__in=mnts).distinct() nameservers = Nameserver.objects.filter(mnt_by__in=mnts).distinct()
reversezones = ReverseZone.objects.filter(Q(parentNet__mnt_by__in=mnts) | Q(parentNet__mnt_lower__in=mnts)).distinct() reversezones = ReverseZone.objects.filter(Q(parentNet__mnt_by__in=mnts) | Q(parentNet__mnt_lower__in=mnts)).distinct()
return render(request, "domains/overview.html", {"domains": domains, "nameservers": nameservers, 'reversezones': reversezones}) return render(request, "domains/overview.html", {"mnts": mnts, "domains": domains, "nameservers": nameservers, 'reversezones': reversezones})
class DomainCreate(LoginRequiredMixin, CreateView): class DomainCreate(LoginRequiredMixin, CreateView):

View File

@ -9,10 +9,12 @@
<div class="panel-heading">DNS Overview</div> <div class="panel-heading">DNS Overview</div>
<div class="panel-body"> <div class="panel-body">
{% if not mnts %}
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<strong>Warning</strong>: You have no maintainer object. Create one <a class="alert-link" href="{% url "whoisdb:dashboard" %}">here</a> before creating domains. <strong>Warning</strong>: You have no maintainer object. Create one <a class="alert-link" href="{% url "whoisdb:dashboard" %}">here</a> before creating domains.
</div> </div>
{% endif %}
<h4>Your Nameservers (<a href="{% url "domains:nameserver-create" %}">New nameserver</a>)</h4> <h4>Your Nameservers (<a href="{% url "domains:nameserver-create" %}">New nameserver</a>)</h4>