diff --git a/uber/configspec.ini b/uber/configspec.ini index 7015ed28f..31bbe28f1 100644 --- a/uber/configspec.ini +++ b/uber/configspec.ini @@ -499,8 +499,15 @@ staff_email = string(default="MAGFest Staffing ") # Dealer-related emails are sent from this address. marketplace_email = string(default="MAGFest Marketplace ") + +# Dealer-related notifications for submitted and edited applications are sent to this address. marketplace_notifications_email = string(default='%(marketplace_email)s') +# If this is set, then marketplace_notifications_email receives an email for +# every submitted dealer application. Otherwise, only edited dealer applications +# trigger an email. +notify_dealer_applied = boolean(default=False) + # Emails to panelists are sent from this address. panels_email = string(default="MAGFest Panels ") diff --git a/uber/site_sections/preregistration.py b/uber/site_sections/preregistration.py index 08cbfce9f..976c0b838 100644 --- a/uber/site_sections/preregistration.py +++ b/uber/site_sections/preregistration.py @@ -32,7 +32,7 @@ def check_if_can_reg(is_dealer_reg=False): if c.DEV_BOX: - pass # Don't redirect to any of the pages below. + pass # Don't redirect to any of the pages below. elif is_dealer_reg and not c.DEALER_REG_OPEN: if c.AFTER_DEALER_REG_START: return render('static_views/dealer_reg_closed.html') @@ -272,17 +272,18 @@ def dealer_registration(self, session, message='', edit_id=None, **params): params['id'] = 'None' # security! group = Group() - badges = params.get('badges', 0) if edit_id is not None: group = self._get_unsaved(edit_id, PreregCart.pending_dealers) - badges = getattr(group, 'badge_count', 0) + params['badges'] = params.get('badges', getattr(group, 'badge_count', 0)) if params.get('old_group_id'): old_group = session.group(params['old_group_id']) old_group_dict = session.group(params['old_group_id']).to_dict(c.GROUP_REAPPLY_ATTRS) group.apply(old_group_dict, ignore_csrf=True, restricted=True) - badges = old_group.badges_purchased + params['badges'] = params.get('badges', old_group.badges_purchased) + + badges = params.get('badges', 0) forms = load_forms(params, group, group_forms, ['ContactInfo', 'TableInfo']) for form in forms.values(): @@ -341,6 +342,13 @@ def finish_dealer_reg(self, session, id, **params): session.add_all([attendee, group]) session.commit() try: + if c.NOTIFY_DEALER_APPLIED: + send_email.delay( + c.MARKETPLACE_EMAIL, + c.MARKETPLACE_NOTIFICATIONS_EMAIL, + '{} Received'.format(c.DEALER_APP_TERM.title()), + render('emails/dealers/reg_notification.txt', {'group': group}, encoding=None), + model=group.to_dict('id')) send_email.delay( c.MARKETPLACE_EMAIL, attendee.email_to_address, diff --git a/uber/static/js/window-hash-tabload.js b/uber/static/js/window-hash-tabload.js index 0ec0ed4b6..264555a9c 100644 --- a/uber/static/js/window-hash-tabload.js +++ b/uber/static/js/window-hash-tabload.js @@ -7,7 +7,6 @@ $().ready(function() { var tab = $(tabID + '-tab'); } catch(error) { new bootstrap.Tab($('.nav-tabs button').first()).show(); - return false; } if(tab && tab.length) { new bootstrap.Tab(tab).show(); diff --git a/uber/templates/preregistration/confirm.html b/uber/templates/preregistration/confirm.html index 94954a4c8..0436a3340 100644 --- a/uber/templates/preregistration/confirm.html +++ b/uber/templates/preregistration/confirm.html @@ -30,7 +30,7 @@ {% include 'confirm_tabs.html' with context %} {% endif %} - {% if c.AFTER_ART_SHOW_REG_START and not attendee.is_new %} + {% if c.ART_SHOW_ENABLED and c.AFTER_ART_SHOW_REG_START and not attendee.is_new %} {% include 'art_show_common/art_show_agent.html' %} {% endif %}