Skip to content
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

Ensure fixture context always contains the key template_inject with a dict value #944

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

laundmo
Copy link
Contributor

@laundmo laundmo commented Nov 12, 2024

This means various fixtures won't have to check if it exists.

Solves the issue that Auth overwrites the entire template_inject dict when Auth.inject is true.

follow-up/related ideas:

  • Unify the various things being added to the render context (request, HELPERS, URL), by adding them to template_inject from the start
  • Allow a way to define template helper functions without having to Inject() in each controller, using a decorator which stores them in a global variable added to template_inject like this
    @template_helper
    def myhelper():
        return "test"

@mdipierro mdipierro merged commit 9d5c779 into web2py:master Nov 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants