From f93de11c6a1cba405e3c119b632a1b71a12a6e1e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 22 Aug 2015 21:04:01 +0530 Subject: [PATCH] networks: Handle unknown connections gracefully When trying to edit connection of unknown type show an error and return to connections list instead of trying to filling in some fields and doing badly. --- plinth/modules/networks/networks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plinth/modules/networks/networks.py b/plinth/modules/networks/networks.py index 67c097d6e..0d03346bf 100644 --- a/plinth/modules/networks/networks.py +++ b/plinth/modules/networks/networks.py @@ -65,6 +65,11 @@ def edit(request, uuid): 'Connection not found.')) return redirect(reverse_lazy('networks:index')) + if connection.get_connection_type() not in network.CONNECTION_TYPE_NAMES: + messages.error(request, + _('This type of connection is not yet understood.')) + return redirect(reverse_lazy('networks:index')) + form = None form_data = {'name': connection.get_id()}