Skip to content

Flowerhack/feature/bulkemailnewdash - #1180

Closed
flowerhack wants to merge 5 commits into
masterfrom
flowerhack/feature/bulkemailnewdash
Closed

Flowerhack/feature/bulkemailnewdash#1180
flowerhack wants to merge 5 commits into
masterfrom
flowerhack/feature/bulkemailnewdash

Conversation

@flowerhack

Copy link
Copy Markdown
Contributor

Bulk email added to new dashboard

@sarina @adampalay

One question I had: I looked into this and, on my local machine, it seemed like I needed to set ENABLE_INSTRUCTOR_EMAIL to True in lms/envs/common.py to make bulk emailing work. Does anyone have any confirmation or insight on this? I'm a little nervous changing a massive settings file for fear of blowing something else up

@ghost ghost assigned adampalay and sarina Sep 30, 2013
@adampalay

Copy link
Copy Markdown
Contributor

Yes, so that's how bulk email will eventually be turned on. Keep it set at False for now, and when the feature is ready to be released, we'll switch it to True. The changes you're making in this PR are invisible for now.

Comment thread lms/djangoapps/instructor/views/api.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't you want to check if has_instructor_access is True or False? And is this the appropriate HttpResponse? (I'm not sure; would it be 403?)

…ed extraneous email.html file, fixed an HttpResponse, deleted unnecessary commented-out code, some small style tweaks
@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

You should definitely not ever introduce more pep8 or pylint errors if you can possibly help it.

http://jenkins.edx.org:8080/job/edx-feature-branch-tests/12398/Diff_Quality_Report/?

Your test coverage is really low: http://jenkins.edx.org:8080/job/edx-feature-branch-tests/12398/Diff_Coverage_Report/? @wedaly is the LMS team's test engineering liaison. Don't hesitate to reach out to him if you need help understanding how to write tests for your code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Parameters

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

Issues:

  • Visually there's been a bunch of regressions. Messages don't pop up to indicate sends have occurred. The spacing of the send to and subject lines are compressed. Text below the box is squished and not bolded. Button says "Send" instead of "Send Email". Compare existing:
    screen shot 2013-10-01 at 11 49 08 am
    to your branch:
    screen shot 2013-10-01 at 11 49 21 am
  • I don't see the email go by in my console output so I don't think it's actually sending the email correctly.

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

Feel free to add in ENABLE_INSTRUCTOR_EMAIL back to dev.py. It was accidentally taken out in this commit: edx@ccc3589#diff-a26715f68224f0a34f87a95db99e9cf4

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

I'd like @jbau and @talbs to take a quick pass at this pull request.

@flowerhack

Copy link
Copy Markdown
Contributor Author

re: not seeing the email go by in the console: that's odd, since I see the email go by in my console locally—I'll look into what may be causing the issue, working on another commit with tests + better visuals now

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

OK. I think my dev env could be wonky as well so if you can see it I'm less concerned. We will be testing your changes in the development server once they're merged in os if there are any issues we will be able to see them before this goes live.

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

Also:

  • Add yourself to AUTHORS
  • Add an entry to CHANGELOG (like commit messages, keep it simple! Always ideally < 70 characters. Eg, "Ported bulk email to beta dashboard")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The scope of this may not just be limited to this PR (since from a cursory glance it appears the rest of the new dashboard works this way), but I'm pretty sure that we don't want to be passing the message in a GET parameter. That seems like a lot of data to stuff into a URL. I think this should naturally be a POST, no?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here's some nginx documentation on the size limits of http request headers:
http://wiki.nginx.org/NginxHttpCoreModule#large_client_header_buffers
It seems to me that it's not impossible to exceed 8K for HTML formatted email messages, so I think it has to be POST.

@jbau

jbau commented Oct 1, 2013

Copy link
Copy Markdown

also, should probably have some unit tests for the python functionality?

@sarina

sarina commented Oct 1, 2013

Copy link
Copy Markdown
Contributor

also, should probably have some unit tests for the python functionality?

Yeah, and probably some acceptance and Javascript tests as well. In an earlier comment I referred Julia to Will if she's unfamiliar with how to write any of these tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a short function, but there's a lot to test here. I'd start by thinking about possible paths:

  1. User is logged in and has instructor access; course exists (happy path)
  2. User does not have instructor access.
  3. User is not logged in.
  4. Course does not exist.

In addition, there are some unhappy paths to test:

  1. Request is missing the "send to" parameter.
  2. Request is missing the "subject" parameter.
  3. Request is missing the "message" parameter.

I'd also expect at least one test with non-ASCII unicode in each of the user-specified fields (this could be your happy-path test). In Python, using unicode incorrectly can cause exceptions, which means users will see a 500 error. Ned gave a great talk about this: see http://nedbatchelder.com/text/unipain.html

Since this code involves JavaScript / Python integration, I'd expect one happy-path test at the UI level. This is something I can help with, since we don't have any existing UI-level tests for the instuctor dash.

@flowerhack

Copy link
Copy Markdown
Contributor Author

@flowerhack flowerhack closed this Oct 8, 2013
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Sep 16, 2016
…lang-when-setlang

Clear dark-lang prefs when changing language in account settings openedx#1177
Agrendalath pushed a commit to open-craft/openedx-platform that referenced this pull request Oct 15, 2018
…discussion-settings-roles-management-api

[MCKIN-8524] Implement an alternative discussion settings, roles management API
iloveagent57 pushed a commit that referenced this pull request Feb 26, 2024
Also includes minor typo fixes.
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.

6 participants