goshencollege / gc-communicator

1 stars 0 forks source link

Feature/approve announcement #49

Closed dboling19 closed 3 years ago

dboling19 commented 3 years ago

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: