last?
This commit is contained in:
parent
216fed8408
commit
a33266ac0f
1 changed files with 5 additions and 5 deletions
10
comments.py
10
comments.py
|
@ -9,16 +9,16 @@ from captcha.image import ImageCaptcha
|
||||||
import time, string
|
import time, string
|
||||||
print("Content-type: text/html\r\n\r\n")
|
print("Content-type: text/html\r\n\r\n")
|
||||||
form=cgi.FieldStorage()
|
form=cgi.FieldStorage()
|
||||||
aid=form["aid"]
|
aid=form["aid"].value
|
||||||
try:
|
try:
|
||||||
seed=form["seed"]
|
seed=form["seed"].value
|
||||||
random.seed(seed)
|
random.seed(seed)
|
||||||
checkstr=list("".join(random.choice(string.digits+string.ascii_lowercase) for _ in range(5)))
|
checkstr=list("".join(random.choice(string.digits+string.ascii_lowercase) for _ in range(5)))
|
||||||
if not checkstr == form["checkstr"]:
|
if not checkstr == form["checkstr"].value:
|
||||||
print("Captcha's wrong")
|
print("Captcha's wrong")
|
||||||
raise Exception()
|
raise Exception()
|
||||||
username=form["username"]
|
username=form["username"].value
|
||||||
message=form["message"]
|
message=form["message"].value
|
||||||
timestamp=int(time.time())
|
timestamp=int(time.time())
|
||||||
data={"name":"","markdown":message,"author":username,"date":timestamp}
|
data={"name":"","markdown":message,"author":username,"date":timestamp}
|
||||||
storage.append("comments-%i"%aid,data)
|
storage.append("comments-%i"%aid,data)
|
||||||
|
|
Loading…
Reference in a new issue