mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-17 11:10:23 +00:00
wireguard: Get config for both download and qr actions
Re-arrange imports Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
629cc866b6
commit
ceaccd7baf
@ -3,6 +3,7 @@
|
||||
Views for WireGuard application.
|
||||
"""
|
||||
|
||||
from io import BytesIO
|
||||
import urllib.parse
|
||||
|
||||
from django.contrib import messages
|
||||
@ -13,8 +14,6 @@ from django.urls import reverse_lazy
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views.generic import FormView, TemplateView, View
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from plinth import network
|
||||
from plinth.modules.names.components import DomainName
|
||||
from plinth.views import AppView
|
||||
@ -117,8 +116,9 @@ class ClientActionsView(SessionClientDataMixin, View):
|
||||
|
||||
def get(self, request):
|
||||
import segno
|
||||
|
||||
config = self.get_client_config(request)
|
||||
if self.action == 'download':
|
||||
config = self.get_client_config(request)
|
||||
response = HttpResponse(config, content_type='text/plain')
|
||||
response['Content-Disposition'] = \
|
||||
'attachment; filename="wg-client.conf"'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user