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

Additional fixes for dealer reg #4205

Merged
merged 1 commit into from
Aug 7, 2023
Merged
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
7 changes: 7 additions & 0 deletions uber/configspec.ini
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,15 @@ staff_email = string(default="MAGFest Staffing <stops@magfest.org>")

# Dealer-related emails are sent from this address.
marketplace_email = string(default="MAGFest Marketplace <marketplace@magfest.org>")

# 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 <panels@magfest.org>")

Expand Down
16 changes: 12 additions & 4 deletions uber/site_sections/preregistration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion uber/static/js/window-hash-tabload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/preregistration/confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
Loading