-
Notifications
You must be signed in to change notification settings - Fork 14
Removed labor meetings from participation history #1685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from 2 commits
a242c2a
6652f86
82291ae
41615f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -364,6 +364,16 @@ def getUpcomingEventsForUser(user, asOf=datetime.now(), program=None): | |
|
|
||
| return eventsList | ||
|
|
||
| def excludeLaborMeeting(): | ||
| eventName = fn.LOWER(Event.name) | ||
| eventDescription = fn.LOWER(Event.description) | ||
|
|
||
| return ( | ||
| eventName.contains("labor meeting") | | ||
| eventName.contains("celts labor meeting") | | ||
|
||
| eventDescription.contains("labor meeting") | ||
|
||
| ) | ||
|
|
||
| def getParticipatedEventsForUser(user): | ||
| """ | ||
| Get all the events a user has participated in. | ||
|
|
@@ -373,17 +383,18 @@ def getParticipatedEventsForUser(user): | |
| :return: A list of Event objects | ||
| """ | ||
|
|
||
| excLaborMeeting = excludeLaborMeeting() | ||
| participatedEvents = (Event.select(Event, Program.programName) | ||
| .join(Program, JOIN.LEFT_OUTER).switch() | ||
| .join(EventParticipant) | ||
| .where(EventParticipant.user == user, | ||
| Event.isAllVolunteerTraining == False, Event.deletionDate == None) | ||
| Event.isAllVolunteerTraining == False, Event.deletionDate == None, ~((Event.isLaborOnly == True) & excLaborMeeting), ~((Event.isTraining == True) & excLaborMeeting)) | ||
|
||
| .order_by(Event.startDate, Event.name)) | ||
|
|
||
| allVolunteer = (Event.select(Event, "") | ||
| .join(EventParticipant) | ||
| .where(Event.isAllVolunteerTraining == True, | ||
| EventParticipant.user == user)) | ||
| EventParticipant.user == user, ~((Event.isLaborOnly == True) & excLaborMeeting), ~((Event.isTraining == True) & excLaborMeeting))) | ||
|
||
| union = participatedEvents.union_all(allVolunteer) | ||
| unionParticipationWithVolunteer = list(union.select_from(union.c.id, union.c.programName, union.c.startDate, union.c.name).order_by(union.c.startDate, union.c.name).execute()) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function makes a clause that determines if the event IS a labor meeting, but is called
excludeLaborMeeting