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.
The user avatar content in the header is now populated with a htmx get request. The request object is used to show either the join link, avatar or no avatar icon.
Issue: #850
- 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
from key
Mark users as claimed when they reset password from profile page
Add method to claim user, and use that method instead
Add docs on unclaimed user accounts
The original code incorrectly assumed that the User object would
always have a first and last name and that they would be unique across
users.
This changes the filename to be "profile-{user.pk}-{10 random
characters}.png" which should ensure there is no overwritting happening.
- Start intercepting signup process to catch existing, unclaimed users
- Add message for unclaimed user trying to register, refactoring as I figured out what I actually needed to touch.
- Got the happy path working; no tests yet
- Need to add tests, docs, the ability to switch the user to `claimed` once they have successfully reset their password
- Add `verbose` flag to `import_versions` to allow user to silence the output
- Removed some unused options from `import_versions`
- Moved the exclusion logic in `import_versions` to its own function
- Stop getting the `github_url` from the github API. Instead, generate it from the tag. (reason: in older tags, the best URL GitHub gives us is a less-useful one to a _commit_ and not a tag. We can generate the url, though.)
- Move the retrieval of the `release_date` to its own task, so it can be loaded async. (reason: it's a separate API call per version to get the date)
- Make `release_date` optional on the `Version` model (reason: make the field easier to load async)
- Simplify logic to retrieve `release_date` and just always retrieve it from the commit
- Stop loading the version `description` from GitHub. We don't use it on the frontend anyway, and in all but the most recent couple of versions, the `description` is the comment from the commit, which is usually not useful.
- Add link to social account management from the profile page
- Override allauth templated related to managing social account connections
- Did my best to apply reasonable styles per other pages
- Add password reset form to single-page profile
- Add profile photo form to single-page profile
- Add button to import photo from GitHub
- Add preferences form to single-page profile
- Add tests for unauthenticated/authenticated users
- Add tests that forms are present
- Add tests that the forms submit, without changing other data