Fixes#986
- Adds a new notification preference to the existing `Preferences` model
and associated form.
- Adds data migration to populate the new preference
- Adds a new test and modifies several others to reflect the new
preference and its behavior
Note the ability to actually send notification will be added
post-launch. If the need comes up in the meantime, it would be
straightforward to manually trigger a notification to opted-in users.
### Manual testing
UI
<img width="553" alt="Screenshot 2024-11-06 at 9 52 52 AM"
src="https://github.com/user-attachments/assets/e7d8ef21-8e21-4fe4-81b0-2e401d10203f">
Data
<img width="478" alt="Screenshot 2024-11-06 at 10 35 11 AM"
src="https://github.com/user-attachments/assets/44237931-05dd-4c38-972f-057321c93945">
---------
Co-authored-by: Greg Kaleka <gkaleka@energy-solution.com>
This also hides the pop up notifications after 6 seconds
For review, a review and merge of #1311 on which this is built would
make this easier to review.
- 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
Part of #343. The news' notifications module was also changed to the user
preferences is honored when sending news emails.
Also exclude migrations from the black check.
- Add a display_name field to the User model
- Implement get_display_name property to return display_name, full name, or a single name, depending on the available information
- Add tests for the get_display_name property