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

Fix scheduled reports encoding #28174

Merged
merged 2 commits into from
Jul 21, 2020
Merged

Fix scheduled reports encoding #28174

merged 2 commits into from
Jul 21, 2020

Conversation

millerdev
Copy link
Contributor

@millerdev millerdev commented Jul 21, 2020

The first commit is the fix, and the second is cleanup to make the code easier to understand.

This is the same type of issue fixed in #28157

See also https://docs.djangoproject.com/en/3.0/releases/2.0/#removed-support-for-bytestrings-in-some-places

@millerdev millerdev added the product/invisible Change has no end-user visible impact label Jul 21, 2020
couch_user=self.user, domain=domain, scheduled_report_id=report._id
)[0]
self.assertTrue(self.user.username in response.decode('utf-8'))
self.assertTrue(self.user.username in report_text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just naively grepping, there are other places where we decode('utf-8') in tests on a response variable, mostly API calls (HQ APIs, SMS, case claim). Do you think those could point to similar issues that deserve followup? (Not in this PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. We may want to look into them.

@@ -878,7 +882,7 @@ def _render_report_configs(request, configs, domain, owner_id, couch_user, email

# Don't send an email if none of the reports configs have started
if len(configs) == 0:
return False, False
return "", []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooray for consistent return values.

@millerdev millerdev merged commit 5de0262 into master Jul 21, 2020
@millerdev millerdev deleted the dm/binary-scheduled-reports branch July 21, 2020 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/invisible Change has no end-user visible impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants