-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: move mako logic to init method #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -47,4 +47,4 @@ def get_tenant_stats(request): | |||
context = {query_param: "true" for query_param in STATS_QUERY_PARAMS} | |||
context.update(request.GET.dict()) | |||
|
|||
return render_to_response("tenant_stats.html", context) | |||
return edxmako.shortcuts.render_to_response("tenant_stats.html", context, "main", request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is need the arg "main" to this render_to_response method,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I think this is related to that main dirs or something to do it with that way.
https://github.com/eduNEXT/eox-nelp/pull/98/files#diff-ec9dfd84694298d271197a0909b7b62e0301e9df3dce5c29d0cec0a8255ebd42L19
eox-nelp/eox_nelp/templates_config.py
Line 19 in 13ed2ff
if path_to_templates not in edxmako.LOOKUP['main'].directories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works without those extra parameters(main and request), however when I was testing that raised an missing parameters error so I decided to pass the default value for the namespace as we do in the current implementation and the current request
run_init_pipeline() | ||
|
||
set_mako_templates_mock.assert_called_once() | ||
patch_user_gender_choices_mock.assert_called_once() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this add gender choices called test xD
There are two parts where the stats and feedback views are called, their own page and the home page so I mentioned the last bragi version since this change just works with the version of eox-nelp that includes the payment notification version |
Description
This covers the edxmako implementation that was proposed in this pr #72 and add some extra changes like removing old implementation and adding unit testing and basically this allows to use any eox-nelp template outside a specific view.
This doesn't include the payment notification template
Testing instructions
/eox-nelp/frontend/experience/feedback/courses/
/eox-nelp/stats/tenant/