mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +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.
|
Views for WireGuard application.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from io import BytesIO
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
@ -13,8 +14,6 @@ from django.urls import reverse_lazy
|
|||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
from django.views.generic import FormView, TemplateView, View
|
from django.views.generic import FormView, TemplateView, View
|
||||||
|
|
||||||
from io import BytesIO
|
|
||||||
|
|
||||||
from plinth import network
|
from plinth import network
|
||||||
from plinth.modules.names.components import DomainName
|
from plinth.modules.names.components import DomainName
|
||||||
from plinth.views import AppView
|
from plinth.views import AppView
|
||||||
@ -117,8 +116,9 @@ class ClientActionsView(SessionClientDataMixin, View):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
import segno
|
import segno
|
||||||
|
|
||||||
|
config = self.get_client_config(request)
|
||||||
if self.action == 'download':
|
if self.action == 'download':
|
||||||
config = self.get_client_config(request)
|
|
||||||
response = HttpResponse(config, content_type='text/plain')
|
response = HttpResponse(config, content_type='text/plain')
|
||||||
response['Content-Disposition'] = \
|
response['Content-Disposition'] = \
|
||||||
'attachment; filename="wg-client.conf"'
|
'attachment; filename="wg-client.conf"'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user