Skip to content

Commit

Permalink
Clean up volunteer shirt logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsuta committed Jun 14, 2024
1 parent 0bb1170 commit 01f01bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions uber/models/attendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,12 +1439,12 @@ def paid_for_a_shirt(self):
@property
def num_free_event_shirts(self):
"""
If someone is staff-shirt-eligible, we use the number of event shirts they have selected (if any)
Volunteers also get a free event shirt.
If someone is staff-shirt-eligible, we use the number of event shirts they have selected (if any).
Volunteers also get a free event shirt. Staff get an event shirt if staff shirts are turned off for the event.
Returns: Integer representing the number of free event shirts this attendee should get.
"""
return max(0, self.num_event_shirts) if self.gets_staff_shirt else self.volunteer_event_shirt_eligible
return max(0, self.num_event_shirts) if self.gets_staff_shirt else bool(
self.volunteer_event_shirt_eligible or (self.badge_type == c.STAFF_BADGE and c.HOURS_FOR_SHIRT))

@property
def volunteer_event_shirt_eligible(self):
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/forms/attendee/badge_extras.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="row g-sm-3">
<div class="col-12 col-sm-6">
<div class="form-text">{{ badge_extras.amount_extra.label.text }}</div>
<div class="form-control-plaintext h5">{{ attendee.amount_extra_label }}{% if c.AVAILABLE_MERCH_TIERS and attendee.amount_extra < c.AVAILABLE_MERCH_TIERS[-1] %}{{ macros.upgrade_button('amount-extra', text="Purchase Merch" if attendee.amount_extra == 0 else "Upgrade") }}{% endif %}</div>
<div class="form-control-plaintext h5">{{ attendee.amount_extra_label or "None" }}{% if c.AVAILABLE_MERCH_TIERS and attendee.amount_extra < c.AVAILABLE_MERCH_TIERS[-1] %}{{ macros.upgrade_button('amount-extra', text="Purchase Merch" if attendee.amount_extra == 0 else "Upgrade") }}{% endif %}</div>
</div>
</div>
{% endif %}
Expand Down

0 comments on commit 01f01bb

Please sign in to comment.