Make 'No VPN' undeletable and add it to every new orga

This commit is contained in:
Kumi 2019-02-19 13:53:03 +00:00
parent 054b791e28
commit 10eab0bbe0
2 changed files with 2 additions and 1 deletions

View file

@ -434,6 +434,7 @@ def makeorganization(request):
data = form.cleaned_data
orga = Organization.objects.create(name=data["name"], userlimit=data["users"])
request.user.organization_set.add(orga)
Network.objects.get(intip="No VPN").organization.add(orga)
return redirect(reverse("organizations"))
else:

View file

@ -124,7 +124,7 @@
<td><div style="display:inline;" title="{% netOrgaString network %}">{{ network.name }}</div></td>
<td>{{ network.intip }}</td>
<td>{{ network.extip }}</td>
<td><a href="#"><i style="color: darkred;" onclick="askdeletenet({{ network.id }});" class="fas fa-trash-alt" title="Delete Network"></i></a></td>
<td>{% if not network.intip == "No VPN" %}<a href="#"><i style="color: darkred;" onclick="askdeletenet({{ network.id }});" class="fas fa-trash-alt" title="Delete Network"></i></a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>