Fixes#1428
Previously, we sent a single email with all recipients in the `bcc`
field, and no one in the `to` field. Mailgun does not support this.
This PR changes that behavior to send an email to each user using
Django's `send_messages` (plural) method.
Note: I wasn't able to confirm this in the Mailgun documentation, but I
assume this should not have any cost implications. Sending a "single"
email with 100 `bcc` recipients should cost the same as sending 100
emails each with a single `to` recipient.
Another note: I did not test performance of this with many recipients.
Probably all of our notification emails should be getting sent in a
Celery task... probably a future optimization.
---------
Co-authored-by: Greg Kaleka <gkaleka@energy-solution.com>
- Adds logic to require the user to have a first or last name to post news
- Adds a test for that
- Removes the "skip" for news tests and skips only the ones that are failing
- Add context processor to return most recent version to base template
- Add property for the stripped slug
- Add context processor to settings and retrieve val in template header
- Fix some news tests that test for specific query counts
fix tests
- Add file type validator
- Apply validator to user image
- Save validator class to variable
- Add image validator to news image model field
- Add file size validator
- Enable file size validator on news and user model image fields
- Fix test
These fields were just using the default max lengths of 50 and 200
respectively. Since `title`s can be up to 255 characters, adjusted
slug to be 300.
Increased external URL to be huge as it's not impactful to performance
really and avoids possible future creation issues.
Fixes#773
- Return the most recent 3 news articles on the main homepage and most recent 2 on the beta homepage, as I wasn't sure which one we were using
- Updated both homepage templates
- Updated tests