Skip to content

Commit

Permalink
Merge pull request #4409 from magfest/fix-attraction-bugs
Browse files Browse the repository at this point in the history
Fix attendee.to_dict and attractions error
  • Loading branch information
kitsuta authored Oct 8, 2024
2 parents e02b5ac + 71e186f commit c914c44
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions uber/models/attendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def to_dict(self, *args, **kwargs):
# Kludgey fix for SQLAlchemy breaking our stuff
d = super().to_dict(*args, **kwargs)
d.pop('attraction_event_signups', None)
d.pop('receipt_changes', None)
return d

@predelete_adjustment
Expand Down
11 changes: 8 additions & 3 deletions uber/templates/attractions/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
$altSignupBModal = bootstrap.Modal.getOrCreateInstance($altSignupModal);
$doneBModal = bootstrap.Modal.getOrCreateInstance($doneModal);

$('#badge-signup-alert').hide();
$('#nonbadge-signup-alert').hide();

$btnShowSoldout.on('click', function(event) {
var isShowing = $btnShowSoldout.hasClass('btn-plain');
$btnShowSoldout.toggleClass('btn-outline-secondary', isShowing);
Expand Down Expand Up @@ -109,12 +112,12 @@
$('#' + eventId + ' .remaining-slots').text(response['remaining_slots']);
callback(response);
} else {
showErrorMessage(response['error'] || 'Error signing up for event', '', {timeOut: 3000});
showErrorMessage(response['error'] || 'Unknown error signing up for event.', 'nonbadge-signup-alert');
callback(false);
}
},
error: function(response, status, statusText) {
showErrorMessage('Error signing up for event', '', {timeOut: 3000});
showErrorMessage('Error signing up for event: could not contact server. Please try again.', 'nonbadge-signup-alert');
callback(false);
}
});
Expand Down Expand Up @@ -142,7 +145,7 @@
if (response['remaining_slots'] === response['old_remaining_slots']) {
message = ' was already signed up for ';
}
$("#message-alert").addClass("alert-info").show().children('span').html($attendee.html() + message + $eventLabel.html());
$("#badge-signup-alert").addClass("alert-info").show().children('span').html($attendee.html() + message + $eventLabel.html());
hideBadgeNumConfirm($doneModal, true);
} else {
hideBadgeNumConfirm($doneModal, false);
Expand Down Expand Up @@ -245,6 +248,7 @@ <h4 class="modal-title">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="alert alert-dismissible" role="alert" id="badge-signup-alert"><span></span>{% if bootstrap5 %}<button type="button" class="btn-close" onClick="hideMessageBox()" aria-label="Close"></button>{% else %}<button type="button" class="close" onClick="hideMessageBox()" aria-label="Close"><span aria-hidden="true">&times;</span></button>{% endif %}</div>
<p>
Sign up for
<span class="text-hilite">{{ feature.attraction.name }} –</span>
Expand Down Expand Up @@ -289,6 +293,7 @@ <h4 class="modal-title">
</div>
<form id="alt_signup_form" method="post" action="sign" role="form">
<div class="modal-body">
<div class="alert alert-dismissible" role="alert" id="nonbadge-signup-alert"><span></span>{% if bootstrap5 %}<button type="button" class="btn-close" onClick="hideMessageBox()" aria-label="Close"></button>{% else %}<button type="button" class="close" onClick="hideMessageBox()" aria-label="Close"><span aria-hidden="true">&times;</span></button>{% endif %}</div>
<p>Enter your personal information to sign up. You must already be registered to sign up for this event.</p>
<div class="row g-sm-3">
<div class="col-12 col-sm-6">
Expand Down
4 changes: 2 additions & 2 deletions uber/templates/attractions_badge_num.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@

var errorMessage = function(response) {
if (response && response['error']) {
showErrorMessage(response['error'], '', {timeOut: 3000});
showErrorMessage(response['error'], 'badge-signup-alert');
} else {
showErrorMessage('Unrecognized badge number: ' + badgeNum, '', {timeOut: 3000});
showErrorMessage('Unrecognized badge number: ' + badgeNum, 'badge-signup-alert');
}
$badgeNum.focus();
};
Expand Down

0 comments on commit c914c44

Please sign in to comment.