def volume_recoverykey_remove(request, object_id): volume = models.Volume.objects.get(id=object_id) if request.method == "POST": form = forms.KeyForm(request.POST) if form.is_valid(): notifier().geli_delkey(volume) return JsonResp(request, message=_("Recovery has been removed")) else: form = forms.KeyForm() return render(request, "storage/recoverykey_remove.html", { 'form': form, })
def volume_key(request, object_id): if request.method == "POST": form = forms.KeyForm(request.POST) if form.is_valid(): request.session["allow_gelikey"] = True return JsonResp( request, message=_("GELI key download starting..."), events=["window.location='%s';" % ( reverse("storage_volume_key_download", kwargs={'object_id': object_id}), )], ) else: form = forms.KeyForm() return render(request, "storage/key.html", { 'form': form, })
def volume_recoverykey_add(request, object_id): volume = models.Volume.objects.get(id=object_id) if request.method == "POST": form = forms.KeyForm(request.POST) if form.is_valid(): reckey = notifier().geli_recoverykey_add(volume) request.session["allow_gelireckey"] = reckey return JsonResp( request, message=_("GELI recovery key download starting..."), events=["window.location='%s';" % ( reverse("storage_volume_recoverykey_download", kwargs={'object_id': object_id}), )], ) else: form = forms.KeyForm() return render(request, "storage/recoverykey_add.html", { 'form': form, })