-
Notifications
You must be signed in to change notification settings - Fork 55
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
New configuration option for free late badges #1703
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -497,7 +497,7 @@ def register(self, session, message='', **params): | |
attendee = session.attendee(params, restricted=True, ignore_csrf=True) | ||
if 'first_name' in params: | ||
message = check(attendee) | ||
if not attendee.payment_method: | ||
if not attendee.payment_method and (not c.BADGE_PRICE_WAIVED or c.BEFORE_BADGE_PRICE_WAIVED): | ||
message = 'Please select a payment type' | ||
elif attendee.payment_method == c.MANUAL and not re.match(c.EMAIL_RE, attendee.email): | ||
message = 'Email address is required to pay with a credit card at our registration desk' | ||
|
@@ -507,7 +507,10 @@ def register(self, session, message='', **params): | |
session.add(attendee) | ||
session.commit() | ||
message = 'Thanks! Please queue in the {} line and have your photo ID and {} ready.' | ||
if attendee.payment_method == c.STRIPE: | ||
if c.AFTER_BADGE_PRICE_WAIVED: | ||
message = "Since it's so close to the end of the event, your badge is free! Please proceed to the preregistration line to pick it up." | ||
attendee.paid = c.NEED_NOT_PAY | ||
elif attendee.payment_method == c.STRIPE: | ||
raise HTTPRedirect('pay?id={}', attendee.id) | ||
elif attendee.payment_method == c.GROUP: | ||
message = 'Please proceed to the preregistration line to pick up your badge.' | ||
|
@@ -564,7 +567,7 @@ def new(self, session, show_all='', message='', checked_in=''): | |
if show_all: | ||
restrict_to = [Attendee.paid == c.NOT_PAID, Attendee.placeholder == False] | ||
else: | ||
restrict_to = [Attendee.registered > datetime.now(UTC) - timedelta(minutes=90)] | ||
restrict_to = [Attendee.paid != c.NEED_NOT_PAY, Attendee.registered > datetime.now(UTC) - timedelta(minutes=90)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although we'll probably stop using this page once badges becomes free, it struck me that there's never any reason for a need not pay badge to ever show up here, so I added that filter. Now free badges added by admins on-site won't show up here either. |
||
|
||
return { | ||
'message': message, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,11 @@ | |
window.setTimeout(toastr.clear, 10000); | ||
|
||
var maybeBold = function() { | ||
if ($.val('payment_method') === {{ c.MANUAL }}) { | ||
$('#email').css('font-weight', 'bold'); | ||
var $emailLabel = $('#email').parents('.form-group').find('label'); | ||
if (!$.field('payment_method') || $.val('payment_method') === {{ c.MANUAL }}) { | ||
$emailLabel.addClass('optional-field'); | ||
} else { | ||
$('#email').css('font-weight', 'normal'); | ||
$emailLabel.removeClass('optional-field'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we can no longer rely on the "Payment Method" field always being present on this page, I added an if check to avoid Javascript errors. |
||
} | ||
}; | ||
$(maybeBold); | ||
|
@@ -40,10 +41,14 @@ | |
<div class="form-group"> | ||
<label class="col-sm-2 control-label">Payment Method</label> | ||
<div class="col-sm-6"> | ||
<select name="payment_method" class="form-control" onChange="maybeBold()"> | ||
<option value="">Select a payment option</option> | ||
{% options c.DOOR_PAYMENT_METHOD_OPTS attendee.payment_method %} | ||
</select> | ||
{% if c.AFTER_BADGE_PRICE_WAIVED %} | ||
<div style="margin-top:10px">All badge types are now free - enjoy {{ c.EVENT_NAME }}!</div> | ||
{% else %} | ||
<select name="payment_method" class="form-control" onChange="maybeBold()"> | ||
<option value="">Select a payment option</option> | ||
{% options c.DOOR_PAYMENT_METHOD_OPTS attendee.payment_method %} | ||
</select> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a terrible, terrible thing for our records? We should be marking them as 'need not pay' right?
Otherwise someone could come in and claim they paid and want a refund, and the system would show that they paid, and we'd be all atizzy trying to figure out what happened.
EDIT: Wait, that's exactly what you do. Can you make the comment reflect reality? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, good catch! I swear I typed "marked as need not pay" but apparently not! Sorry for the confusion, I'll push out an updated comment in just a minute.