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
[WIP] jinja2 whitespace stripping and email testing #5385
Conversation
Automated message from Dropbox CLA bot @vaidap, it looks like you've already signed the Dropbox CLA. Thanks! |
zproject/settings.py
Outdated
@@ -335,6 +335,8 @@ def get_secret(key): | |||
}) | |||
non_html_template_engine_settings['OPTIONS'].update({ | |||
'autoescape': False, | |||
# 'trim_blocks': True, |
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.
did you mean to leave these commented out?
zerver/views/test_emails.py
Outdated
@@ -48,6 +48,7 @@ def email_page(request): | |||
}, | |||
'referrer_name': 'Road Runner', | |||
'referrer_email': 'runner@acme.com', | |||
'referrer_realm_name': 'The Road Runners', |
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 should probably be "Acme Corporation"
Thanks @vaidap! Left two small comments. |
sorry for those silly mistakes! updated now. |
Codecov Report
@@ Coverage Diff @@
## master #5385 +/- ##
======================================
Coverage 86.5% 86.5%
======================================
Files 430 430
Lines 53111 53111
Branches 2069 2069
======================================
Hits 45942 45942
Misses 7169 7169
Continue to review full report at Codecov.
|
Great, thanks @vaidap! For the first commit, it would be good to go through all the text emails at |
i'm having troubles understanding the task @rishig, would be amazing if you could expand on this: when it comes to fixing the spacing, is it for things such as
? |
@vaidap A kind of hacky way to generate output from jinja2 templates is to open a python shell and load the templates there
Then you can write to a text file and |
For many of them, you can also go to localhost:9991/emails in the dev environment. |
Though at this point I think it might actually make sense for @jrowan to take this over, since he's editing so much of the text anyway. Would both of you be ok with that? |
I'd be fine with that, especially since I feel more comfortable with helping with the design than with the templating work! |
Sure, I'll work on this. |
Merged! Thanks @vaidap! |
ah oops, probably should not have been merged! Fine for now though, we'll fix anything off in the other email PR. |
fixes #5274.
The only places I found control blocks not being on their own line was in
digest.txt
&missed_message.txt
(both of them will be redone so i left them as-is), andinvitation_reminder.subject
-- i didn't find it to cause problems as it's all in one line.the second commit adds a test value so
invitation_reminder.subject
triggers the{% if referrer_realm_name %}
block.