more appropriate error codes

This commit is contained in:
sose 2020-12-24 15:24:57 +00:00
parent 91119103a9
commit e241faf766
1 changed files with 3 additions and 3 deletions

View File

@ -78,15 +78,15 @@ class MessageBoard:
client_hash = self.env["TLS_CLIENT_HASH"]
if post is not None and post.cert_hash != client_hash:
print("60", "You are not authorized to modify this post.")
print("61", "You are not authorized to modify this post.")
return False
client_cert = self.db.hash_to_cert(client_hash)
if client_cert is None:
print("60", "Cert hash not in db.")
print("61", "Cert hash not in db.")
return False
if self.ca.verify_cert(client_cert) != True:
print("60", "You are banned.")
print("61", "You are banned.")
return False
return True