Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
add default value for emailservice env var (#608)
Browse files Browse the repository at this point in the history
fixes #607

The service was trying to run `.lower()` on an unset env var, resulting in spammy logs. I added a default value of false to the field to fix this
  • Loading branch information
daniel-sanche committed Dec 15, 2020
1 parent b8c1a69 commit 5e19444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/emailservice/email_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def SendOrderConfirmation(self, request, context):
class DummyEmailService(BaseEmailService):
def SendOrderConfirmation(self, request, context):
logger.info('A request to send order confirmation email to {} has been received.'.format(request.email))
if os.getenv('ENCODE_EMAIL').lower() == 'true':
if os.getenv('ENCODE_EMAIL', 'false').lower() == 'true':
try:
encoded_email = self.EncodeEmail(request.email)
request.email = encoded_email
Expand Down

0 comments on commit 5e19444

Please sign in to comment.