Render hints on server side and don't render them client side (#1564)

* Render hints on the server side inline with challenge descriptions and Pages
* Clean up some of the API responses for hints to include the right data
* Closes #1563
This commit is contained in:
Kevin Chung
2020-07-22 16:04:45 -04:00
committed by GitHub
parent bea74c2068
commit ded612d46b
10 changed files with 20 additions and 25 deletions

View File

@@ -6,12 +6,12 @@ class HintSchema(ma.ModelSchema):
class Meta:
model = Hints
include_fk = True
dump_only = ("id", "type")
dump_only = ("id", "type", "html")
views = {
"locked": ["id", "type", "challenge", "cost"],
"unlocked": ["id", "type", "challenge", "content", "cost"],
"admin": ["id", "type", "challenge", "content", "cost", "requirements"],
"unlocked": ["id", "type", "challenge", "content", "html", "cost"],
"admin": ["id", "type", "challenge", "content", "html", "cost", "requirements"],
}
def __init__(self, view=None, *args, **kwargs):