def repo(request, repo_id): """Show repo page and handle POST request to decrypt repo. """ repo = get_repo(repo_id) if not repo: raise Http404 if request.method == 'GET': return render_repo(request, repo) elif request.method == 'POST': form = RepoPassowrdForm(request.POST) next = get_next_url_from_request(request) or reverse('repo', args=[repo_id]) if form.is_valid(): return HttpResponseRedirect(next) else: return render_to_response( 'decrypt_repo_form.html', { 'repo': repo, 'form': form, 'next': next, 'force_server_crypto': FORCE_SERVER_CRYPTO, }, context_instance=RequestContext(request))
def repo(request, repo_id): """Show repo page and handle POST request to decrypt repo. """ repo = get_repo(repo_id) if not repo: raise Http404 if request.method == 'GET': return render_repo(request, repo) elif request.method == 'POST': form = RepoPassowrdForm(request.POST) next = get_next_url_from_request(request) or reverse( 'repo', args=[repo_id]) if form.is_valid(): return HttpResponseRedirect(next) else: return render_to_response( 'decrypt_repo_form.html', { 'repo': repo, 'form': form, 'next': next, 'force_server_crypto': FORCE_SERVER_CRYPTO, }, context_instance=RequestContext(request))
def repo(request, repo_id): """Show repo page and handle POST request to decrypt repo. """ repo = get_repo(repo_id) if not repo: raise Http404 if request.method == "GET": return render_repo(request, repo) elif request.method == "POST": form = RepoPassowrdForm(request.POST) next = get_next_url_from_request(request) or reverse("repo", args=[repo_id]) if form.is_valid(): return HttpResponseRedirect(next) else: return render_to_response( "decrypt_repo_form.html", {"repo": repo, "form": form, "next": next}, context_instance=RequestContext(request), )