many things have occured
This commit is contained in:
parent
02b6b7d592
commit
db70df22a2
23 changed files with 281 additions and 167 deletions
|
@ -1,8 +1,9 @@
|
|||
import redis
|
||||
from realms import config
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
# Default DB connection
|
||||
from realms import config
|
||||
|
||||
db = create_engine(config.DB_URI, encoding='utf8', echo=True)
|
||||
|
||||
# Default Cache connection
|
||||
|
|
|
@ -59,11 +59,12 @@ def to_dict(cur, first=False):
|
|||
else:
|
||||
return ret
|
||||
|
||||
|
||||
def validate_captcha():
|
||||
response = captcha.submit(
|
||||
request.form['recaptcha_challenge_field'],
|
||||
request.form['recaptcha_response_field'],
|
||||
config.flask['RECAPTCHA_PRIVATE_KEY'],
|
||||
config.RECAPTCHA_PRIVATE_KEY,
|
||||
request.remote_addr)
|
||||
return response.is_valid
|
||||
|
||||
|
@ -125,4 +126,4 @@ def to_canonical(s):
|
|||
|
||||
|
||||
def gravatar_url(email):
|
||||
return "https://www.gravatar.com/avatar/" + hashlib.md5(email).hexdigest()
|
||||
return "//www.gravatar.com/avatar/" + hashlib.md5(email).hexdigest()
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
import lxml.html
|
||||
from lxml.html.clean import Cleaner
|
||||
import ghdiff
|
||||
import gittle.utils
|
||||
from gittle import Gittle
|
||||
|
@ -92,7 +93,9 @@ class Wiki():
|
|||
|
||||
tree = lxml.html.fromstring(content)
|
||||
|
||||
cleaner = lxml.html.Cleaner(remove_unknown_tags=False, kill_tags=set(['style']), safe_attrs_only=False)
|
||||
cleaner = Cleaner(remove_unknown_tags=False,
|
||||
kill_tags=set(['style']),
|
||||
safe_attrs_only=False)
|
||||
tree = cleaner.clean_html(tree)
|
||||
|
||||
content = lxml.html.tostring(tree, encoding='utf-8', method='html')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue