diff --git a/plinth/modules/networks/networks.py b/plinth/modules/networks/networks.py index 7c0ec3ede..e01854814 100644 --- a/plinth/modules/networks/networks.py +++ b/plinth/modules/networks/networks.py @@ -19,6 +19,7 @@ from django.contrib import messages from django.core.urlresolvers import reverse_lazy from django.shortcuts import redirect from django.template.response import TemplateResponse +from django.views.decorators.http import require_POST from gettext import gettext as _ from logging import Logger @@ -167,6 +168,7 @@ def edit(request, uuid): 'form': form}) +@require_POST def activate(request, uuid): """Activate the connection.""" try: @@ -184,6 +186,7 @@ def activate(request, uuid): return redirect(reverse_lazy('networks:index')) +@require_POST def deactivate(request, uuid): """Deactivate the connection.""" try: diff --git a/plinth/modules/networks/templates/connections_list.html b/plinth/modules/networks/templates/connections_list.html index 462a5eea9..34ee28b4a 100644 --- a/plinth/modules/networks/templates/connections_list.html +++ b/plinth/modules/networks/templates/connections_list.html @@ -23,15 +23,23 @@ {% block page_head %} {% endblock %} @@ -59,35 +67,41 @@ {{ connection.type }} {% if connection.is_active %} -
- - -
+
+ + +
{% else %} -
- - -
+
+ + +
{% endif %}