Skip to content
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

wip: getting email count of attendees #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion event_exim/connectors/actionkit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class Connector:
other_fields = ['ee.id', 'ee.creator_id', 'ee.campaign_id', 'ee.phone', 'ee.notes',
'ec.title', 'signuppage.name', 'createpage.name',
'host.id', 'hostaction.id', 'hostaction2.action_ptr_id', 'hostcreateaction.action_ptr_id',
'u.id', 'u.first_name', 'u.last_name', 'u.email', 'loc.us_district', 'recentphone.value']
'u.id', 'u.first_name', 'u.last_name', 'u.email', 'loc.us_district', 'recentphone.value',
'COUNT(emails.body_id) AS emailcount']

event_fields = ['review_status', 'prep_status',
'needs_organizer_help', 'political_scope', 'public_phone', 'venue_category']
Expand Down Expand Up @@ -93,6 +94,7 @@ class Connector:
" LEFT JOIN core_eventsignupaction hostaction2 ON (hostaction2.signup_id = host.id)"
" LEFT JOIN core_eventcreatepage cec ON (cec.campaign_id = ee.campaign_id)"
" LEFT JOIN core_page createpage ON (createpage.id = cec.page_ptr_id AND createpage.hidden=0 AND createpage.status='active')"
" LEFT JOIN events_emaillog emails ON (emails.event_id = ee.id)"
" %(eventjoins)s "
" xxADDITIONAL_WHERExx " #will be replaced with text or empty string on run
# we need to include hostcreateaction in group by so it doesn't get squashed with first match
Expand Down Expand Up @@ -284,6 +286,7 @@ def _convert_event(self, event_rows):
'create_page': event_row[fi['createpage.name']],
'create_action_id': cohost_create_action,
'hosts': hosts,
'emailstoattendees': event_row[fi['COUNT(emails.body_id) AS emailcount']],
}),
})
for df in self.date_fields:
Expand Down
1 change: 1 addition & 0 deletions event_exim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class EventDupeGuesses(models.Model):

class Meta:
unique_together = (('source_event','dupe_event'),)
# TODO: reverse order by recency

@staticmethod
def get_potential_dupes():
Expand Down