-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Markup(...).unescape() #3
Comments
In routes_pages.py we have several spots where we seem to actually properly Markup(...).unescape() the data from the front end before to commit it to the DB. If that's the case then why do we have to do it all over again in routes_pages.py when sending the data to the jinja2 templates??!! Lines 80 to 95 in 7bb7941
Lines 263 to 264 in 7bb7941
|
In models, we apparently started doing the right thing in dump_as_dict. Lines 42 to 57 in 7bb7941
Lines 97 to 99 in 7bb7941
Lines 124 to 139 in 7bb7941
|
Right now, we use these Markup(...).unescape throughout the server-side code in order to prepare the content to be rendered in the jinja2 templates, using the | safe filter.
We should really instead apply these transformations to the contents as it is sent to the server (routes_pages.py or routes_mcq.py mostly I'd guess) and before it is inserted in the DB. Potential target for this would be the models maybe. This way, we would not have to constantly apply them when we're about to serve the content and just send directly what's in the DB to the jinja2 templates.
EvoPIE/evopie/routes_pages.py
Lines 47 to 51 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 71 to 73 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 97 to 104 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 144 to 146 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 162 to 164 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 180 to 184 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 230 to 238 in 7bb7941
EvoPIE/evopie/routes_pages.py
Lines 276 to 293 in 7bb7941
The text was updated successfully, but these errors were encountered: