-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use the default templates when a custom template file cannot be found #8037
Commits on Aug 5, 2020
-
Remove conditional requirement for already required Jinja2
Not sure if we need to keep the conditional requirement name though...
Configuration menu - View commit details
-
Copy full SHA for 3d4f917 - Browse repository at this point
Copy the full SHA 3d4f917View commit details
Commits on Aug 6, 2020
-
Create a generic function to read jinja2 templates
Create a generic function to read template files, which are also treated as jinja2 templates whether they have any custom variables or not. The goal is for this function to be used across the codebase. At the moment it is located in emailconfig.py, but I'd like to move it to another config file at some point along with the rest of the template options.
Configuration menu - View commit details
-
Copy full SHA for 0046454 - Browse repository at this point
Copy the full SHA 0046454View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ace21a - Browse repository at this point
Copy the full SHA 4ace21aView commit details -
Change create_mxc_to_http_filter to public function
We'll be using it in other files in subsequent commits
Configuration menu - View commit details
-
Copy full SHA for e3c75b1 - Browse repository at this point
Copy the full SHA e3c75b1View commit details -
Update synapse/push/pusher.py to use read_templates
jinja2 and bleach are no longer optional dependencies.
Configuration menu - View commit details
-
Copy full SHA for dd81441 - Browse repository at this point
Copy the full SHA dd81441View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15f5aa0 - Browse repository at this point
Copy the full SHA 15f5aa0View commit details -
Convert synapse/handlers/account_validity.py to use read_templates
Also remove guard on importing load_jinja2_templates here
Configuration menu - View commit details
-
Copy full SHA for 6f9e4b0 - Browse repository at this point
Copy the full SHA 6f9e4b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1ba6be - Browse repository at this point
Copy the full SHA e1ba6beView commit details -
Configuration menu - View commit details
-
Copy full SHA for 44dc4aa - Browse repository at this point
Copy the full SHA 44dc4aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for c8f105b - Browse repository at this point
Copy the full SHA c8f105bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e8799e8 - Browse repository at this point
Copy the full SHA e8799e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d442bf - Browse repository at this point
Copy the full SHA 2d442bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7034971 - Browse repository at this point
Copy the full SHA 7034971View commit details -
Configuration menu - View commit details
-
Copy full SHA for 00f4f63 - Browse repository at this point
Copy the full SHA 00f4f63View commit details
Commits on Aug 14, 2020
-
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/def…
…ault_templates * 'develop' of github.com:matrix-org/synapse: (57 commits) Remove a space at the start of a changelog entry. More changelog tweaks More changelog tweaks Remove unwanted changelog line 1.19.0rc1 Run `remove_push_actions_from_staging` in foreground (#8081) Drop federation transmission queues during a significant remote outage. (#7864) Fix unawaited coroutine error in tests. (#8072) Convert the roommember database to async/await. (#8070) Convert devices database to async/await. (#8069) Add type hints to handlers.message and events.builder (#8067) Convert account data, device inbox, and censor events databases to async/await (#8063) Convert appservice, group server, profile and more databases to async (#8066) Fix typing for notifier (#8064) Convert tags and metrics databases to async/await (#8062) Converts event_federation and registration databases to async/await (#8061) Add comment explaining cast Update changelog.d/8051.misc Add typing info to Notifier (#8058) Handle optional dependencies for Oidc and Saml ...
Configuration menu - View commit details
-
Copy full SHA for 2e7de8d - Browse repository at this point
Copy the full SHA 2e7de8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b674bf - Browse repository at this point
Copy the full SHA 7b674bfView commit details -
Simplify template loading code
Turns out jinja2.FilesystemLoader can take a list of directories to look for a given filename in, so there's no need to check for the file ourselves. We also now reuse the jinja2.Environment object
Configuration menu - View commit details
-
Copy full SHA for 57c64c4 - Browse repository at this point
Copy the full SHA 57c64c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93555f4 - Browse repository at this point
Copy the full SHA 93555f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab3f058 - Browse repository at this point
Copy the full SHA ab3f058View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcb04ad - Browse repository at this point
Copy the full SHA bcb04adView commit details -
Configuration menu - View commit details
-
Copy full SHA for c77608c - Browse repository at this point
Copy the full SHA c77608cView commit details -
Add docstring and improve create_mxc_to_http_filter
The urllib -> urllib.parse switch was because we use urllib.parse in the code which afaik only works because we're importing urlib.parse elsewhere, which is flakey
Configuration menu - View commit details
-
Copy full SHA for bf79f9e - Browse repository at this point
Copy the full SHA bf79f9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 49dbd26 - Browse repository at this point
Copy the full SHA 49dbd26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dfca15 - Browse repository at this point
Copy the full SHA 1dfca15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45d6e4c - Browse repository at this point
Copy the full SHA 45d6e4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for de41b66 - Browse repository at this point
Copy the full SHA de41b66View commit details -
Raise ConfigError if custom template directory does not exist
So that people are warned early that their assumed custom template directory is in fact doing nothing
Configuration menu - View commit details
-
Copy full SHA for e7ca492 - Browse repository at this point
Copy the full SHA e7ca492View commit details -
Configuration menu - View commit details
-
Copy full SHA for c81cdb6 - Browse repository at this point
Copy the full SHA c81cdb6View commit details
Commits on Aug 17, 2020
-
Switch all read_templates calls from handlers to synapse.config
Lots of general cleanup of the template code in emailconfig. The account_validity config option bit was that I noticed what we were pulling out of the config had been done elsewhere already. Also move filter functions from synapse.push.mailer to synapse.config._base as otherwise we were facing circular imports (plus it makes sense to keep them by read_templates anyhow).
Configuration menu - View commit details
-
Copy full SHA for 87fea4c - Browse repository at this point
Copy the full SHA 87fea4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7660398 - Browse repository at this point
Copy the full SHA 7660398View commit details -
Use custom filters on all templates
The performance difference is negligible and cleans up some duplicate code.
Configuration menu - View commit details
-
Copy full SHA for d9d8d72 - Browse repository at this point
Copy the full SHA d9d8d72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 405db9a - Browse repository at this point
Copy the full SHA 405db9aView commit details -
Only abspath the template_dir if it's set
Otherwise a TypeError will be raised if template_dir is uncommented but not set to anything Additionally remove default_template_dir here as read_templates handles that for us.
Configuration menu - View commit details
-
Copy full SHA for 93b71d8 - Browse repository at this point
Copy the full SHA 93b71d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1d7d9c - Browse repository at this point
Copy the full SHA a1d7d9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94300cc - Browse repository at this point
Copy the full SHA 94300ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for f08b610 - Browse repository at this point
Copy the full SHA f08b610View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b943e6 - Browse repository at this point
Copy the full SHA 7b943e6View commit details -
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 5806a08 - Browse repository at this point
Copy the full SHA 5806a08View commit details -
Configuration menu - View commit details
-
Copy full SHA for c654916 - Browse repository at this point
Copy the full SHA c654916View commit details -
Configuration menu - View commit details
-
Copy full SHA for d35c049 - Browse repository at this point
Copy the full SHA d35c049View commit details -
Render sso deactived/success templates
We switched from reading them directly from disk to making them into jinja2.Template files, which broke stuff. We now render them to turn them back into text.
Configuration menu - View commit details
-
Copy full SHA for 116a895 - Browse repository at this point
Copy the full SHA 116a895View commit details