Previously showing sitewide alert (e.g. about service breaks) is set in the settings file, meaning that A+ needs to be restarted for it take effect.
Why?
Setting alert in settings file is unnecessarily complicated e.g. in Kubernetes environment. This could be implemented it in such way (e.g. using DB) that an A+ user with sufficient privileges can update it during runtime, without needing to restart the whole Django app.
How?
The solution created a model named "Site alerts" in admin page where admin can add one or multiple alerts along with their status (Active / Removed). Alerts with Active status will be shown on A+.
Fixes #1047
Testing
Remember to add or update unit tests for new features and changes.
The issue was tested by adding multiple entries in "Site alerts" model, all alerts with Active status were being displayed on A+. No alerts are displayed if there are no entries in "Site alerts" model at all or if there are no entries present with Active status.
Did you test the changes in
[x] Chrome
[ ] Firefox
[ ] This pull request cannot be tested in the browser.
Think of what is affected by these changes and could become broken
Fixes #1047
Description
What?
Previously showing sitewide alert (e.g. about service breaks) is set in the settings file, meaning that A+ needs to be restarted for it take effect.
Why?
Setting alert in settings file is unnecessarily complicated e.g. in Kubernetes environment. This could be implemented it in such way (e.g. using DB) that an A+ user with sufficient privileges can update it during runtime, without needing to restart the whole Django app.
How?
The solution created a model named "Site alerts" in admin page where admin can add one or multiple alerts along with their status (Active / Removed). Alerts with Active status will be shown on A+.
Fixes #1047
Testing
Remember to add or update unit tests for new features and changes.
What type of test did you run?
The issue was tested by adding multiple entries in "Site alerts" model, all alerts with Active status were being displayed on A+. No alerts are displayed if there are no entries in "Site alerts" model at all or if there are no entries present with Active status.
Did you test the changes in
Think of what is affected by these changes and could become broken
Translation
Programming style
Have you updated the README or other relevant documentation?
Is it Done?
Clean up your git commit history before submitting the pull request!