diff --git a/pinaxcon/registrasion/management/commands/populate_inventory.py b/pinaxcon/registrasion/management/commands/populate_inventory.py index d2b635c52fabfc9d37162f9cc8c99dbd75e99998..617048504f9187a43898c800a6880034aea979e6 100644 --- a/pinaxcon/registrasion/management/commands/populate_inventory.py +++ b/pinaxcon/registrasion/management/commands/populate_inventory.py @@ -81,59 +81,59 @@ class Command(BaseCommand): render_type=inv.Category.RENDER_TYPE_CHECKBOX, order=10, ) - self.penguin_dinner = self.find_or_make( - inv.Category, - ("name",), - name="Penguin Dinner Ticket", - description="Tickets to our conference dinner on the evening of " - f"{settings.PENGUIN_DINNER_TICKET_DATE: %A %d %B}. " - "All attendees may purchase " - "seats at the dinner, even if a dinner ticket is not " - "included in your conference ticket price.", - required=False, - render_type=inv.Category.RENDER_TYPE_QUANTITY, - limit_per_user=10, - order=20, - ) - self.speakers_dinner_ticket = self.find_or_make( - inv.Category, - ("name",), - name="Speakers' Dinner Ticket", - description="Tickets to our exclusive Speakers' Dinner on the " - "evening of " - f"{settings.SPEAKER_DINNER_TICKET_DATE: %A %d %B}.", - required=False, - render_type=inv.Category.RENDER_TYPE_QUANTITY, - limit_per_user=1, - order=30, - ) - self.pdns_category = self.find_or_make( - inv.Category, - ("name",), - name="Professional Delegates Networking Session Ticket", - description="Tickets to our Professional Delegates Networking session. " - "This event will be held on the evening of " - f"{settings.PDNS_TICKET_DATE: %A %d %B} " - "and is restricted to Professional Ticket " - "holders, speakers, miniconf organisers, and invited " - "guests.", - required=False, - render_type=inv.Category.RENDER_TYPE_RADIO, - limit_per_user=1, - order=40, - ) - self.t_shirt = self.find_or_make( - inv.Category, - ("name",), - name="Shirt", - description="Commemorative conference shirts, featuring the " - f"linux.conf.au {settings.LCA_START.year} artwork. " - "View the " - "sizing guide.", - required=False, - render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY, - order=50, - ) + # self.penguin_dinner = self.find_or_make( + # inv.Category, + # ("name",), + # name="Penguin Dinner Ticket", + # description="Tickets to our conference dinner on the evening of " + # f"{settings.PENGUIN_DINNER_TICKET_DATE: %A %d %B}. " + # "All attendees may purchase " + # "seats at the dinner, even if a dinner ticket is not " + # "included in your conference ticket price.", + # required=False, + # render_type=inv.Category.RENDER_TYPE_QUANTITY, + # limit_per_user=10, + # order=20, + # ) + # self.speakers_dinner_ticket = self.find_or_make( + # inv.Category, + # ("name",), + # name="Speakers' Dinner Ticket", + # description="Tickets to our exclusive Speakers' Dinner on the " + # "evening of " + # f"{settings.SPEAKER_DINNER_TICKET_DATE: %A %d %B}.", + # required=False, + # render_type=inv.Category.RENDER_TYPE_QUANTITY, + # limit_per_user=1, + # order=30, + # ) + # self.pdns_category = self.find_or_make( + # inv.Category, + # ("name",), + # name="Professional Delegates Networking Session Ticket", + # description="Tickets to our Professional Delegates Networking session. " + # "This event will be held on the evening of " + # f"{settings.PDNS_TICKET_DATE: %A %d %B} " + # "and is restricted to Professional Ticket " + # "holders, speakers, miniconf organisers, and invited " + # "guests.", + # required=False, + # render_type=inv.Category.RENDER_TYPE_RADIO, + # limit_per_user=1, + # order=40, + # ) + # self.t_shirt = self.find_or_make( + # inv.Category, + # ("name",), + # name="Shirt", + # description="Commemorative conference shirts, featuring the " + # f"linux.conf.au {settings.LCA_START.year} artwork. " + # "View the " + # "sizing guide.", + # required=False, + # render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY, + # order=50, + # ) # self.accommodation = self.find_or_make( # inv.Category, # ("name",), @@ -153,6 +153,20 @@ class Command(BaseCommand): # limit_per_user=1, # order=50, # ) + self.badge_category = self.find_or_make( + inv.Category, + ("name",), + name="Swag Badge", + description="We have a limited number of " + "Swag Badges available " + "for attendees of linux.conf.au 2021. " + "They will be allocated on a first come, first serve basis. " + "Please note that they are only available to Australian " + "attendees due to shipping limitations.", + required=False, + render_type=inv.Category.RENDER_TYPE_CHECKBOX, + order=50, + ) self.extras = self.find_or_make( inv.Category, ("name",), @@ -202,33 +216,15 @@ class Command(BaseCommand): reservation_duration=hours(24), order=30, ) - self.ticket_miniconfs_mt = self.find_or_make( + self.ticket_miniconf_only = self.find_or_make( inv.Product, ("name", "category",), category=self.ticket, - name=settings.MINICONF_MT.name, - price=settings.MINICONF_MT.regular_price, + name=settings.MINICONF_ONLY.name, + price=settings.MINICONF_ONLY.regular_price, reservation_duration=hours(24), order=40, ) - self.ticket_miniconfs_mon = self.find_or_make( - inv.Product, - ("name", "category",), - category=self.ticket, - name=settings.MINICONF_M.name, - price=settings.MINICONF_M.regular_price, - reservation_duration=hours(24), - order=42, - ) - self.ticket_miniconfs_tue = self.find_or_make( - inv.Product, - ("name", "category",), - category=self.ticket, - name=settings.MINICONF_MT.name, - price=settings.MINICONF_MT.regular_price, - reservation_duration=hours(24), - order=44, - ) self.ticket_speaker = self.find_or_make( inv.Product, ("name", "category",), @@ -287,42 +283,42 @@ class Command(BaseCommand): limit_per_user=1, ) - for t in settings.PENGUIN_DINNER.tickets: - self.find_or_make( - inv.Product, - ("name", "category",), - category=self.penguin_dinner, - name=t.name, - description=t.description, - price=t.price, - reservation_duration=t.reservation, - order=t.order() - ) - - for t in settings.SPEAKERS_DINNER.tickets: - self.find_or_make( - inv.Product, - ("name", "category",), - category=self.speakers_dinner_ticket, - name=t.name, - description=t.description, - price=t.price, - reservation_duration=t.reservation, - order=t.order() - ) + # for t in settings.PENGUIN_DINNER.tickets: + # self.find_or_make( + # inv.Product, + # ("name", "category",), + # category=self.penguin_dinner, + # name=t.name, + # description=t.description, + # price=t.price, + # reservation_duration=t.reservation, + # order=t.order() + # ) + + # for t in settings.SPEAKERS_DINNER.tickets: + # self.find_or_make( + # inv.Product, + # ("name", "category",), + # category=self.speakers_dinner_ticket, + # name=t.name, + # description=t.description, + # price=t.price, + # reservation_duration=t.reservation, + # order=t.order() + # ) # PDNS - self.pdns = self.find_or_make( - inv.Product, - ("name", "category",), - category=self.pdns_category, - name="Conference Attendee", - price=Decimal("00.00"), - reservation_duration=hours(1), - limit_per_user=1, - order=10, - ) + # self.pdns = self.find_or_make( + # inv.Product, + # ("name", "category",), + # category=self.pdns_category, + # name="Conference Attendee", + # price=Decimal("00.00"), + # reservation_duration=hours(1), + # limit_per_user=1, + # order=10, + # ) # # Accommodation @@ -340,6 +336,17 @@ class Command(BaseCommand): # Extras + self.swag_badge = self.find_or_make( + inv.Product, + ("name", "category",), + category=self.badge_category, + name="I would like a Swag Badge (if available)", + price=Decimal("0.00"), + reservation_duration=hours(24), + limit_per_user=1, + order=10, + ) + self.carbon_offset = self.find_or_make( inv.Product, ("name", "category",), @@ -347,44 +354,45 @@ class Command(BaseCommand): name="Offset the carbon pollution generated by your attendance, " "thanks to fifteen trees.", price=Decimal("5.00"), - reservation_duration=hours(1), + reservation_duration=hours(24), order=10, ) + # Shirts - ShirtGroup = namedtuple("ShirtGroup", ("prefix", "sizes")) - shirt_names = { - "straight": ShirtGroup( - "Straight Cut", - ("S", "M", "L", "XL", "2XL", "3XL", "4XL", "5XL"), - ), - "semi_fitted": ShirtGroup( - "Semi-Fitted", - ("XS", "S", "M", "L", "XL", "2XL"), - ), - "fitted": ShirtGroup( - "Fitted", - ("XS", "S", "M", "L", "XL", "2XL"), - ), - } - - self.shirts = {} - order = 0 - for name, group in shirt_names.items(): - self.shirts[name] = {} - prefix = group.prefix - for size in group.sizes: - product_name = "%s %s" % (prefix, size) - order += 10 - self.shirts[name][size] = self.find_or_make( - inv.Product, - ("name", "category",), - name=product_name, - category=self.t_shirt, - price=settings.TSHIRT_PRICE, - reservation_duration=hours(1), - order=order, - ) + # ShirtGroup = namedtuple("ShirtGroup", ("prefix", "sizes")) + # shirt_names = { + # "straight": ShirtGroup( + # "Straight Cut", + # ("S", "M", "L", "XL", "2XL", "3XL", "4XL", "5XL"), + # ), + # "semi_fitted": ShirtGroup( + # "Semi-Fitted", + # ("XS", "S", "M", "L", "XL", "2XL"), + # ), + # "fitted": ShirtGroup( + # "Fitted", + # ("XS", "S", "M", "L", "XL", "2XL"), + # ), + # } + + # self.shirts = {} + # order = 0 + # for name, group in shirt_names.items(): + # self.shirts[name] = {} + # prefix = group.prefix + # for size in group.sizes: + # product_name = "%s %s" % (prefix, size) + # order += 10 + # self.shirts[name][size] = self.find_or_make( + # inv.Product, + # ("name", "category",), + # name=product_name, + # category=self.t_shirt, + # price=settings.TSHIRT_PRICE, + # reservation_duration=hours(1), + # order=order, + # ) def populate_restrictions(self): @@ -399,9 +407,6 @@ class Command(BaseCommand): hide_voucher_products.products.set([ self.ticket_media, self.ticket_sponsor, - self.ticket_miniconfs_mt, - self.ticket_miniconfs_mon, - self.ticket_miniconfs_tue, ]) hide_all_tickets = self.find_or_make( @@ -416,6 +421,7 @@ class Command(BaseCommand): self.ticket_professional, self.ticket_hobbyist, self.ticket_student, + self.ticket_miniconf_only, ]) # Set limits. @@ -497,38 +503,38 @@ class Command(BaseCommand): self.ticket_speaker, ]) - penguin_dinner_cap = self.find_or_make( - cond.TimeOrStockLimitFlag, - ("description", ), - description="Penguin dinner ticket cap", - condition=cond.FlagBase.DISABLE_IF_FALSE, - limit=900, - ) - penguin_dinner_cap.categories.set([ - self.penguin_dinner, - ]) - - speakers_dinner_cap = self.find_or_make( - cond.TimeOrStockLimitFlag, - ("description", ), - description="Speakers dinner ticket cap", - condition=cond.FlagBase.DISABLE_IF_FALSE, - limit=135, - ) - speakers_dinner_cap.categories.set([ - self.speakers_dinner_ticket, - ]) - - pdns_cap = self.find_or_make( - cond.TimeOrStockLimitFlag, - ("description", ), - description="PDNS ticket cap", - condition=cond.FlagBase.DISABLE_IF_FALSE, - limit=400, - ) - pdns_cap.categories.set([ - self.pdns_category, - ]) + # penguin_dinner_cap = self.find_or_make( + # cond.TimeOrStockLimitFlag, + # ("description", ), + # description="Penguin dinner ticket cap", + # condition=cond.FlagBase.DISABLE_IF_FALSE, + # limit=900, + # ) + # penguin_dinner_cap.categories.set([ + # self.penguin_dinner, + # ]) + + # speakers_dinner_cap = self.find_or_make( + # cond.TimeOrStockLimitFlag, + # ("description", ), + # description="Speakers dinner ticket cap", + # condition=cond.FlagBase.DISABLE_IF_FALSE, + # limit=135, + # ) + # speakers_dinner_cap.categories.set([ + # self.speakers_dinner_ticket, + # ]) + + # pdns_cap = self.find_or_make( + # cond.TimeOrStockLimitFlag, + # ("description", ), + # description="PDNS ticket cap", + # condition=cond.FlagBase.DISABLE_IF_FALSE, + # limit=400, + # ) + # pdns_cap.categories.set([ + # self.pdns_category, + # ]) # Volunteer tickets are for volunteers only volunteers = self.find_or_make( @@ -567,57 +573,57 @@ class Command(BaseCommand): speaker_tickets.products.set([self.ticket_speaker, ]) # Speaker dinner tickets are for primary speakers only - speaker_dinner_tickets = self.find_or_make( - cond.SpeakerFlag, - ("description", ), - description="Speaker dinner tickets", - condition=cond.FlagBase.ENABLE_IF_TRUE, - is_presenter=True, - is_copresenter=False, - ) - speaker_dinner_tickets.proposal_kind.set(self.main_conference_proposals) - speaker_dinner_tickets.categories.set([self.speakers_dinner_ticket, ]) + # speaker_dinner_tickets = self.find_or_make( + # cond.SpeakerFlag, + # ("description", ), + # description="Speaker dinner tickets", + # condition=cond.FlagBase.ENABLE_IF_TRUE, + # is_presenter=True, + # is_copresenter=False, + # ) + # speaker_dinner_tickets.proposal_kind.set(self.main_conference_proposals) + # speaker_dinner_tickets.categories.set([self.speakers_dinner_ticket, ]) # PDNS tickets are complicated. # They can be enabled by tickets - pdns_by_ticket = self.find_or_make( - cond.ProductFlag, - ("description", ), - description="PDNS available by ticket", - condition=cond.FlagBase.ENABLE_IF_TRUE, - ) - pdns_by_ticket.enabling_products.set([ - self.ticket_professional, - self.ticket_contributor, - self.ticket_media, - self.ticket_sponsor, - ]) - pdns_by_ticket.categories.set([self.pdns_category, ]) + # pdns_by_ticket = self.find_or_make( + # cond.ProductFlag, + # ("description", ), + # description="PDNS available by ticket", + # condition=cond.FlagBase.ENABLE_IF_TRUE, + # ) + # pdns_by_ticket.enabling_products.set([ + # self.ticket_professional, + # self.ticket_contributor, + # self.ticket_media, + # self.ticket_sponsor, + # ]) + # pdns_by_ticket.categories.set([self.pdns_category, ]) # They are available to speakers - pdns_by_speaker = self.find_or_make( - cond.SpeakerFlag, - ("description", ), - description="PDNS available to speakers", - condition=cond.FlagBase.ENABLE_IF_TRUE, - is_presenter=True, - is_copresenter=True, + # pdns_by_speaker = self.find_or_make( + # cond.SpeakerFlag, + # ("description", ), + # description="PDNS available to speakers", + # condition=cond.FlagBase.ENABLE_IF_TRUE, + # is_presenter=True, + # is_copresenter=True, - ) - pdns_by_speaker.proposal_kind.set(self.main_conference_proposals) - pdns_by_speaker.categories.set([self.pdns_category, ]) + # ) + # pdns_by_speaker.proposal_kind.set(self.main_conference_proposals) + # pdns_by_speaker.categories.set([self.pdns_category, ]) # They are available to staff - pdns_by_staff = self.find_or_make( - cond.GroupMemberFlag, - ("description", ), - description="PDNS available to staff", - condition=cond.FlagBase.ENABLE_IF_TRUE, - ) - pdns_by_staff.group.set([ - self.group_team, - ]) - pdns_by_staff.categories.set([self.pdns_category, ]) + # pdns_by_staff = self.find_or_make( + # cond.GroupMemberFlag, + # ("description", ), + # description="PDNS available to staff", + # condition=cond.FlagBase.ENABLE_IF_TRUE, + # ) + # pdns_by_staff.group.set([ + # self.group_team, + # ]) + # pdns_by_staff.categories.set([self.pdns_category, ]) # Don't allow people to get anything if they don't have a ticket first needs_a_ticket = self.find_or_make( @@ -629,9 +635,9 @@ class Command(BaseCommand): ) needs_a_ticket.categories.set([ self.extras, - self.t_shirt, - self.penguin_dinner, - self.pdns_category, + # self.t_shirt, + # self.penguin_dinner, + # self.pdns_category, ]) # Require attendees to accept the T&Cs and Code of Conduct needs_agreement = self.find_or_make( @@ -643,10 +649,10 @@ class Command(BaseCommand): ) needs_agreement.categories.set([ self.extras, - self.t_shirt, - self.penguin_dinner, - self.pdns_category, - self.speakers_dinner_ticket, + # self.t_shirt, + # self.penguin_dinner, + # self.pdns_category, + # self.speakers_dinner_ticket, ]) def populate_discounts(self): @@ -679,30 +685,30 @@ class Command(BaseCommand): ) # Early Bird Discount (general public) - early_bird_hobbyist_discount = self.find_or_make( - cond.TimeOrStockLimitDiscount, - ("description", ), - description="Early Bird Discount - Hobbyist", - end_time=settings.EARLY_BIRD_DEADLINE, - limit=150, # Across all users - ) - self.find_or_make( - cond.DiscountForProduct, - ("discount", "product"), - discount=early_bird_hobbyist_discount, - product=self.ticket_hobbyist, - price=settings.HOBBYIST.earlybird_discount(), - quantity=1, # Per user - ) + # early_bird_hobbyist_discount = self.find_or_make( + # cond.TimeOrStockLimitDiscount, + # ("description", ), + # description="Early Bird Discount - Hobbyist", + # end_time=settings.EARLY_BIRD_DEADLINE, + # limit=150, # Across all users + # ) + # self.find_or_make( + # cond.DiscountForProduct, + # ("discount", "product"), + # discount=early_bird_hobbyist_discount, + # product=self.ticket_hobbyist, + # price=settings.HOBBYIST.earlybird_discount(), + # quantity=1, # Per user + # ) - early_bird = self.find_or_make( - cond.TimeOrStockLimitDiscount, - ("description", ), - description="Early Bird Discount - Professional", - end_time=settings.EARLY_BIRD_DEADLINE, - limit=200, # Across professionals and fairy sponsors - ) - add_early_birds(early_bird) + # early_bird = self.find_or_make( + # cond.TimeOrStockLimitDiscount, + # ("description", ), + # description="Early Bird Discount - Professional", + # end_time=settings.EARLY_BIRD_DEADLINE, + # limit=200, # Across professionals and fairy sponsors + # ) + # add_early_birds(early_bird) # Early bird rates for speakers speaker_ticket_discounts = self.find_or_make( @@ -726,7 +732,7 @@ class Command(BaseCommand): is_copresenter=False, ) primary_speaker.proposal_kind.set(self.main_conference_proposals) - free_category(primary_speaker, self.speakers_dinner_ticket) + # free_category(primary_speaker, self.speakers_dinner_ticket) # Professional-Like ticket inclusions ticket_prolike_inclusions = self.find_or_make( @@ -741,8 +747,8 @@ class Command(BaseCommand): self.ticket_sponsor, self.ticket_speaker, ]) - free_category(ticket_prolike_inclusions, self.penguin_dinner) - free_category(ticket_prolike_inclusions, self.t_shirt) + # free_category(ticket_prolike_inclusions, self.penguin_dinner) + # free_category(ticket_prolike_inclusions, self.t_shirt) # Hobbyist ticket inclusions ticket_hobbyist_inclusions = self.find_or_make( @@ -753,7 +759,7 @@ class Command(BaseCommand): ticket_hobbyist_inclusions.enabling_products.set([ self.ticket_hobbyist, ]) - free_category(ticket_hobbyist_inclusions, self.t_shirt) + # free_category(ticket_hobbyist_inclusions, self.t_shirt) # Student ticket inclusions ticket_student_inclusions = self.find_or_make( @@ -764,7 +770,7 @@ class Command(BaseCommand): ticket_student_inclusions.enabling_products.set([ self.ticket_student, ]) - free_category(ticket_student_inclusions, self.t_shirt) + # free_category(ticket_student_inclusions, self.t_shirt) # Team ticket inclusions ticket_staff_inclusions = self.find_or_make( @@ -775,19 +781,19 @@ class Command(BaseCommand): ticket_staff_inclusions.enabling_products.set([ self.ticket_team, ]) - free_category(ticket_staff_inclusions, self.penguin_dinner) + # free_category(ticket_staff_inclusions, self.penguin_dinner) # Team & volunteer shirts, regardless of ticket type - staff_t_shirts = self.find_or_make( - cond.GroupMemberDiscount, - ("description", ), - description="Shirts complimentary for staff and volunteers", - ) - staff_t_shirts.group.set([ - self.group_team, - self.group_volunteers, - ]) - free_category(staff_t_shirts, self.t_shirt, quantity=5) + # staff_t_shirts = self.find_or_make( + # cond.GroupMemberDiscount, + # ("description", ), + # description="Shirts complimentary for staff and volunteers", + # ) + # staff_t_shirts.group.set([ + # self.group_team, + # self.group_volunteers, + # ]) + # free_category(staff_t_shirts, self.t_shirt, quantity=5) print(f"{self.count} categories found/made")