mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-08 22:07:55 +00:00
postkey: add "success" view
This commit is contained in:
parent
60ba81d91c
commit
e191306c7e
@ -2,4 +2,5 @@ from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('web.postkey.views',
|
||||
(r'^$', 'addkey'),
|
||||
(r'^success/', 'success'),
|
||||
)
|
||||
|
@ -54,10 +54,16 @@ def addkey(request):
|
||||
if request.method == 'POST':
|
||||
form = AddForm(request.POST)
|
||||
if form.is_valid():
|
||||
#form.save()
|
||||
return HttpResponseRedirect('/postkey/success/')
|
||||
form.save()
|
||||
request.session['hostname'] = form.cleaned_data['name']
|
||||
return HttpResponseRedirect('success')
|
||||
else:
|
||||
form = AddForm()
|
||||
return render_to_response('postkey.html', {
|
||||
'form': form,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
def success(request):
|
||||
return render_to_response('success_submission.html', {
|
||||
'hostname': request.session['hostname'],
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user