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

Prereg launch updates #4239

Merged
merged 3 commits into from
Sep 12, 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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ ENV DEFAULT_URL=
ENV DEBUG=false
ENV SESSION_HOST=redis
ENV SESSION_PORT=6379
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV SESSION_PREFIX=uber
ENV BROKER_PROTOCOL=amqp
ENV BROKER_HOST=rabbitmq
Expand Down
4 changes: 2 additions & 2 deletions uber-development.ini.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ hostname = "${HOSTNAME}"
url_root = "http://${HOSTNAME}:${PORT}"

[redis]
host = "${SESSION_HOST}"
port = ${SESSION_PORT}
host = "${REDIS_HOST}"
port = ${REDIS_PORT}

[secret]
broker_url = "${BROKER_PROTOCOL}://${BROKER_USER}:${BROKER_PASS}@${BROKER_HOST}:${BROKER_PORT}/${BROKER_VHOST}"
Expand Down
4 changes: 2 additions & 2 deletions uber/site_sections/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def form(self, session, message='', return_to='', **params):
if c.BADGE_PROMO_CODES_ENABLED and 'promo_code' in params:
message = session.add_promo_code_to_attendee(attendee, params.get('promo_code'))

if not message:
if not message and not attendee.placeholder:
message = check(attendee)

if not message:
Expand Down Expand Up @@ -1075,7 +1075,7 @@ def update_attendee(self, session, message='', success=False, **params):
if c.BADGE_PROMO_CODES_ENABLED and 'promo_code' in params:
message = session.add_promo_code_to_attendee(attendee, params.get('promo_code'))

if not message:
if not message and not attendee.placeholder:
message = check(attendee)

if not message:
Expand Down
11 changes: 8 additions & 3 deletions uber/site_sections/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,16 @@ def index(self, session):
for label, opts in count_labels.items():
for val, desc in opts:
counts[label][desc] = 0
stocks = c.BADGE_PRICES['stocks']
badge_stocks = c.BADGE_PRICES['stocks']
for var in c.BADGE_VARS:
badge_type = getattr(c, var)
counts['stocks'][c.BADGES[badge_type]] = stocks.get(var.lower(), 'no limit set')
counts['counts'][c.BADGES[badge_type]] = c.get_badge_count_by_type(badge_type)
counts['badge_stocks'][c.BADGES[badge_type]] = badge_stocks.get(var.lower(), 'no limit set')
counts['badge_counts'][c.BADGES[badge_type]] = c.get_badge_count_by_type(badge_type)

shirt_stocks = c.SHIRT_SIZE_STOCKS
for shirt_enum_key in c.PREREG_SHIRTS.keys():
counts['shirt_stocks'][c.PREREG_SHIRTS[shirt_enum_key]] = shirt_stocks.get(shirt_enum_key, 'no limit set')
counts['shirt_counts'][c.PREREG_SHIRTS[shirt_enum_key]] = c.REDIS_STORE.hget(c.REDIS_PREFIX + 'shirt_counts', shirt_enum_key)

for a in session.query(Attendee).options(joinedload(Attendee.group)):
counts['paid'][a.paid_label] += 1
Expand Down
20 changes: 18 additions & 2 deletions uber/templates/statistics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h4>Badge Counts by Type</h4>
Badges that count against badge stocks -- these represent the physical badges we have promised attendees so far.
<br/>
<ul>
{% for desc, count in counts.counts.items() %}
{% for desc, count in counts.badge_counts.items() %}
<li><i>{{ desc }}:</i> {{ count }}</li>
{% endfor %}
</ul>
Expand All @@ -46,11 +46,27 @@ <h4>Check-ins by Badge Type</h4>

<h4>Badge Stocks</h4>
<ul>
{% for desc, count in counts.stocks.items() %}
{% for desc, count in counts.badge_stocks.items() %}
<li><i>{{ desc }}:</i> {{ count }}</li>
{% endfor %}
</ul>

<h4>Shirt Size Stocks</h4>
<ul>
{% for desc, count in counts.shirt_stocks.items() %}
<li><i>{{ desc }}:</i> {{ count }}</li>
{% endfor %}
</ul>

<h4>Shirt Size Counts</h4>
The number of each shirt size that is claimed by an attendee -- these are counted against shirt size stocks, but DO NOT represent the number of shirts we need to manufacture. The algorithm matches that of our preordered merch counts to make sure we don't oversell.
<br/>
<ul>
{% for desc, count in counts.shirt_counts.items() %}
<li><i>{{ desc }}:</i> {{ count }}</li>
{% endfor %}
</ul>

<h4>Interests</h4>
<ul>
{% for desc, count in counts.interests.items() %}
Expand Down
Loading