|
@@ -33,21 +33,6 @@ class VPNView(SuccessMessageMixin, UpdateView):
|
|
return get_object_or_404(VPNConfiguration, pk=self.kwargs.get("id"),
|
|
return get_object_or_404(VPNConfiguration, pk=self.kwargs.get("id"),
|
|
offersubscription__member=self.request.user)
|
|
offersubscription__member=self.request.user)
|
|
|
|
|
|
-def generate_password(request, id):
|
|
|
|
- """This generates a random password, saves it in hashed form, and returns
|
|
|
|
- it to the user in cleartext.
|
|
|
|
- """
|
|
|
|
- vpn = get_object_or_404(VPNConfiguration, pk=id,
|
|
|
|
- offersubscription__member=request.user)
|
|
|
|
- # This function has nothing to here, but it's convenient.
|
|
|
|
- password = Member.objects.make_random_password()
|
|
|
|
- vpn.password = password
|
|
|
|
- # This will hash the password automatically
|
|
|
|
- vpn.full_clean()
|
|
|
|
- vpn.save()
|
|
|
|
- return render_to_response('vpn/fragments/password.html', {"vpn": vpn,
|
|
|
|
- "password": password})
|
|
|
|
-
|
|
|
|
|
|
|
|
class VPNGeneratePasswordView(VPNView):
|
|
class VPNGeneratePasswordView(VPNView):
|
|
"""This generates a random password, saves it in hashed form, and returns
|
|
"""This generates a random password, saves it in hashed form, and returns
|