Adds the ability for moderators and above to approve announcements. New announcements will be created with approval set to 0 as false. Moderators and admins can access the new page at ~/moderation/announcements where a simple button-press will set an announcement to approved, which will only then be displayed on the overview page.
Fixes
Fixed old tests, mainly the ones for recurrence, to work better with the new queries and reformatted it for readability and processing efficiency.
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
[X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
I created a new test test_approval which queries for *today_approved() and saves the count. Then it creates an un-approved announcement, checks that there is no increase in the count, and creates an approved announcement, then checks that the count increased by 1.
Checklist:
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[X] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
Description
Adds the ability for moderators and above to approve announcements. New announcements will be created with approval set to 0 as false. Moderators and admins can access the new page at
~/moderation/announcements
where a simple button-press will set an announcement to approved, which will only then be displayed on the overview page.Fixes
Fixed old tests, mainly the ones for recurrence, to work better with the new queries and reformatted it for readability and processing efficiency.
Type of change
How Has This Been Tested?
I created a new test
test_approval
which queries for*today_approved()
and saves the count. Then it creates an un-approved announcement, checks that there is no increase in the count, and creates an approved announcement, then checks that the count increased by 1.Checklist: