diff --git a/Dockerfile b/Dockerfile index fada6918c..3e05bcc1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/uber-development.ini.template b/uber-development.ini.template index 2d4bf7424..ec62094e1 100644 --- a/uber-development.ini.template +++ b/uber-development.ini.template @@ -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}" diff --git a/uber/site_sections/registration.py b/uber/site_sections/registration.py index f0f518221..089ce0096 100644 --- a/uber/site_sections/registration.py +++ b/uber/site_sections/registration.py @@ -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: @@ -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: diff --git a/uber/site_sections/statistics.py b/uber/site_sections/statistics.py index fca041c17..eb0ed07cf 100644 --- a/uber/site_sections/statistics.py +++ b/uber/site_sections/statistics.py @@ -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 diff --git a/uber/templates/statistics/index.html b/uber/templates/statistics/index.html index fb823113e..d2221c57a 100644 --- a/uber/templates/statistics/index.html +++ b/uber/templates/statistics/index.html @@ -30,7 +30,7 @@