Skip to content

Commit

Permalink
Merge pull request #4292 from magfest/update-guest-autographs-reports
Browse files Browse the repository at this point in the history
Update Guest autograph reports
  • Loading branch information
kitsuta authored Nov 29, 2023
2 parents dc7e7fd + 2b40246 commit 8030ee1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
2 changes: 2 additions & 0 deletions uber/configspec.ini
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ tabletop_tournament_slack = integer(default=5)
# guests
# =============================

rock_island_email = string(default="MAGFest Rock Island <[email protected]>")

band_email = string(default="MAGFest Music Department <[email protected]>")
band_email_signature = string(default="- MAGFest Music Department")

Expand Down
15 changes: 12 additions & 3 deletions uber/site_sections/guest_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def checklist_info_csv(self, out, session):
'Twitter', 'Instagram', 'Twitch', 'Bandcamp', 'Discord', 'Other Social Media', 'Bio Pic', 'Bio Pic Link',
'Wants Panel', 'Panel Name',
'Panel Length', 'Panel Description', 'Panel Tech Needs',
'# of Autograph Sessions', 'Autograph Session Length (Minutes)',
'Wants RI Meet & Greet', 'Meet & Greet Length (Minutes)',
'Completed W9', 'Stage Plot',
'Selling Merchandise',
'Charity Answer', 'Charity Donation',
Expand All @@ -53,6 +55,8 @@ def checklist_info_csv(self, out, session):
getattr(guest.panel, 'wants_panel', ''), getattr(guest.panel, 'name', ''),
getattr(guest.panel, 'length', ''), getattr(guest.panel, 'desc', ''),
' / '.join(getattr(guest.panel, 'panel_tech_needs_labels', '')),
getattr(guest.autograph, 'num', ''), getattr(guest.autograph, 'length', ''),
getattr(guest.autograph, 'rock_island_autographs', ''), getattr(guest.autograph, 'rock_island_length', ''),
getattr(guest.taxes, 'w9_sent', ''), absolute_stageplot_url,
getattr(guest.merch, 'selling_merch_label', ''),
getattr(guest.charity, 'donating_label', ''), getattr(guest.charity, 'desc', ''),
Expand Down Expand Up @@ -147,9 +151,14 @@ def _inventory_sort_key(item):
@csv_file
def autograph_requests(self, out, session):
out.writerow([
'Group Name', '# of Sessions', 'Session Length (Minutes)',
'Group Name', '# of Sessions', 'Session Length (Minutes)', 'Wants RI Meet & Greet', 'Meet & Greet Length (Minutes)'
])

autograph_sessions = session.query(GuestAutograph).filter(GuestAutograph.num > 0)
autograph_sessions = session.query(GuestAutograph).filter(or_(GuestAutograph.num > 0,
GuestAutograph.rock_island_autographs == True))
for request in autograph_sessions:
out.writerow([request.guest.group.name, request.num, request.length])
out.writerow([request.guest.group.name,
request.num,
request.length,
request.rock_island_autographs,
request.rock_island_length])
13 changes: 11 additions & 2 deletions uber/site_sections/guests.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,19 @@ def autograph(self, session, guest_id, message='', **params):
guest = session.guest_group(guest_id)
guest_autograph = session.guest_autograph(params)
if cherrypy.request.method == 'POST':
guest_autograph.length = 60 * int(params.get('length'), 0) # Convert hours to minutes
guest_autograph.rock_island_length = 60 * int(params.get('rock_island_length', 0)) # Convert hours to minutes
guest.autograph = guest_autograph
session.add(guest_autograph)
guest_autograph.length = 60 * int(params.get('length'), 0) # Convert hours to minutes
guest_autograph.rock_island_length = 60 * int(params.get('rock_island_length', 0)) # Convert hours to minutes

if guest_autograph.rock_island_autographs or \
guest_autograph.orig_value_of('rock_island_autographs') != guest_autograph.rock_island_autographs:
send_email.delay(
c.ROCK_ISLAND_EMAIL,
c.ROCK_ISLAND_EMAIL,
'{} Meet & Greet Notification'.format(guest.group.name),
render('emails/guests/meetgreet_notification.txt', {'guest': guest}, encoding=None),
model=guest.to_dict('id'))
raise HTTPRedirect('index?id={}&message={}', guest.id, 'Your autograph sessions have been saved')

return {
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/emails/guests/charity_notification.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ They have said they can donate the following:
{{ guest.charity.desc }}{% endif %}


Their group leader is {{ guest.group.leader.full_name }} and their email address is {{ guest.group.leader.email }}
Their group leader is {{ guest.group.leader.full_name }} and their email address is {{ guest.group.leader.email }}.
7 changes: 7 additions & 0 deletions uber/templates/emails/guests/meetgreet_notification.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"{{ guest.group.name }}" has just updated their meet and greet preferences. They {% if guest.autograph.rock_island_autographs %}DO{% else %}DO NOT{% endif %} want to run a meet and greet.{% if guest.autograph.rock_island_autographs %}


They want a {{ guest.autograph.rock_island_length // 60 }}-hour session.{% endif %}


Their group leader is {{ guest.group.leader.full_name }} and their email address is {{ guest.group.leader.email }}.
2 changes: 2 additions & 0 deletions uber/templates/group_admin/guests.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@
{% if c.HAS_GUEST_REPORTS_ACCESS %}
<p><a href="../guest_reports/rock_island">View all Rock Island merch</a></p>
<p><a href="../guest_reports/checklist_info_csv">Export all checklist data as a CSV file</a></p>
<p><a href="../guest_reports/autograph_requests">Autographs CSV</a></p>
<p><a href="../guest_reports/detailed_travel_info_csv">Detailed Travel Info CSV</a></p>
{% endif %}

0 comments on commit 8030ee1

Please sign in to comment.