diff options
Diffstat (limited to 'wqflask/wqflask/docs.py')
-rw-r--r-- | wqflask/wqflask/docs.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py index 0187f32e..23fc3cad 100644 --- a/wqflask/wqflask/docs.py +++ b/wqflask/wqflask/docs.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import, print_function, division +import codecs from flask import g @@ -9,7 +9,7 @@ class Docs(object): def __init__(self, entry, start_vars={}): sql = """ - SELECT Docs.title, Docs.content + SELECT Docs.title, CAST(Docs.content AS BINARY) FROM Docs WHERE Docs.entry LIKE %s """ @@ -19,8 +19,10 @@ class Docs(object): self.title = self.entry.capitalize() self.content = "" else: + self.title = result[0] - self.content = result[1] + self.content = result[1].decode("utf-8") + self.editable = "false" # ZS: Removing option to edit to see if text still gets vandalized @@ -40,4 +42,4 @@ def update_text(start_vars): sql = "UPDATE Docs SET content='{0}' WHERE entry='{1}';".format(content, start_vars['entry_type']) g.db.execute(sql) except: - pass
\ No newline at end of file + pass |