simmons-tech / Simmons-Website

simmons.mit.edu
4 stars 5 forks source link

Fix problem with incorrect lounge event count in reminders #43

Closed ammubhave closed 10 years ago

ammubhave commented 10 years ago

SDS had a problem with showing up of reminders in lounge proposals.

What is the Bug: Right now, if there is a lounge event proposal made by someone it shows up as "you need to response to 1 lounge proposal" notification in the bottom right. But if you don't answer that proposal and the proposal later passes due to majority, the valid field in the lounge_expenses table gets set and the proposal is removed from the proposals page since the event is over. BUT the notifications in the bottom right still show that you have one lounge proposal to respond to. Even though you actually can't respond to that proposal as it is already finished. The reminder goes away only at the end of term when termsold field gets updated.

This patch fixes up this issue. The issue lies in the code which generates reminders. The select command during the generation does not take into account if the valid field is set or unset. It only takes into account whether he person has voted or the event has been cancelled.

The patch adds an extra condition in the where clause explicitly stating that only show proposal notifications for the proposals which are NOT valid for an approved expense, i.e. which are still open.

The patch also adds a new notification for the unresponded event expenses which have already been approved. The proposals which gets approved for funds are moved to the Lounge Expenses tab, but the reminder on the bottom right navigates to the proposals link (due to all the reasons mentioned above). This patch adds a new category of notifications which makes a notification saying "you need to response to lounge expenses" and then redirects to the lounge expenses page where the actual respond form is.