|
@@ -5,6 +5,8 @@ from django.http import StreamingHttpResponse
|
|
|
from django.shortcuts import render_to_response, get_object_or_404
|
|
|
from django.views.generic.detail import DetailView
|
|
|
from django.conf import settings
|
|
|
+from django.contrib.auth.decorators import login_required
|
|
|
+from django.utils.decorators import method_decorator
|
|
|
|
|
|
from coin.members.models import Member
|
|
|
from coin.vpn.models import VPNConfiguration
|
|
@@ -12,6 +14,10 @@ from coin.vpn.models import VPNConfiguration
|
|
|
|
|
|
class VPNView(DetailView):
|
|
|
|
|
|
+ @method_decorator(login_required)
|
|
|
+ def dispatch(self, *args, **kwargs):
|
|
|
+ return super(VPNView, self).dispatch(*args, **kwargs)
|
|
|
+
|
|
|
def get_object(self):
|
|
|
return get_object_or_404(VPNConfiguration, pk=self.kwargs.get("id"),
|
|
|
offersubscription__member=self.request.user)
|