]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/commitdiff
Report error if required parameter 'q' is missing
authorOleg Broytman <phd@phdru.name>
Tue, 20 May 2014 02:44:39 +0000 (06:44 +0400)
committerOleg Broytman <phd@phdru.name>
Tue, 20 May 2014 04:31:56 +0000 (08:31 +0400)
search-tags.py

index 6675a896935f07a040c1c3c2e38989a6a990c9f0..cbac10c6bbdac3eee8d9b171667938976afdfeeb 100755 (executable)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-"""Search tags"""
+"""Search tags CGI"""
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2014 PhiloSoft Design"
@@ -7,7 +7,12 @@ __license__ = "GNU GPL"
 
 import cgi
 from parse_query import parser
+from html.response import response
 
 form = cgi.FieldStorage()
 if not form.has_key('q'):
-    print "Error"
+    status = "400 Bad request"
+    title = "Error!"
+    body = "Required parameter is missing!"
+
+response(title, body, status)