1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-09 22:38:08 +00:00

pyi2phosts/postkey/views.py: check for hostname presence in success()

This commit is contained in:
Hidden Z 2010-11-05 06:32:25 +00:00
parent 37994951c1
commit 16c142a5c1

View File

@ -59,9 +59,12 @@ def addkey(request):
}, context_instance=RequestContext(request))
def success(request):
return render_to_response('success_submission.html', {
'title': settings.SITE_NAME,
'hostname': request.session['hostname'],
})
if 'hostname' in request.session:
return render_to_response('success_submission.html', {
'title': settings.SITE_NAME,
'hostname': request.session['hostname'],
})
else:
return redirect('/')
log = get_logger(filename=settings.LOG_FILE, log_level=settings.LOG_LEVEL)