diff --git a/pinaxcon/registrasion/forms.py b/pinaxcon/registrasion/forms.py index 17ef9ef2..7bb21f1e 100644 --- a/pinaxcon/registrasion/forms.py +++ b/pinaxcon/registrasion/forms.py @@ -28,5 +28,4 @@ class ProfileForm(forms.ModelForm): } field_classes = { "of_legal_age": YesNoField, - "agreement": YesNoField, } diff --git a/pinaxcon/registrasion/management/commands/populate_inventory.py b/pinaxcon/registrasion/management/commands/populate_inventory.py index 77a43795..0607cc04 100644 --- a/pinaxcon/registrasion/management/commands/populate_inventory.py +++ b/pinaxcon/registrasion/management/commands/populate_inventory.py @@ -67,6 +67,20 @@ class Command(BaseCommand): limit_per_user=1, order=1, ) + self.terms = self.find_or_make( + inv.Category, + ("name",), + name="Terms, Conditions, and Code of Conduct Acceptance", + description="I agree to the " + " " + "terms and conditions of attendance, and I have read, " + "understood, and agree to act according to the standards set " + "forth in our " + "Code of Conduct.", + required=True, + render_type=inv.Category.RENDER_TYPE_CHECKBOX, + order=10, + ) self.penguin_dinner = self.find_or_make( inv.Category, ("name",), @@ -78,7 +92,7 @@ class Command(BaseCommand): required=False, render_type=inv.Category.RENDER_TYPE_QUANTITY, limit_per_user=10, - order=10, + order=20, ) self.speakers_dinner_ticket = self.find_or_make( inv.Category, @@ -91,7 +105,7 @@ class Command(BaseCommand): required=False, render_type=inv.Category.RENDER_TYPE_QUANTITY, limit_per_user=5, - order=20, + order=30, ) self.pdns_category = self.find_or_make( inv.Category, @@ -105,7 +119,7 @@ class Command(BaseCommand): required=False, render_type=inv.Category.RENDER_TYPE_RADIO, limit_per_user=1, - order=30, + order=40, ) self.t_shirt = self.find_or_make( inv.Category, @@ -115,7 +129,7 @@ class Command(BaseCommand): "linux.conf.au 2018 artwork.", required=False, render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY, - order=40, + order=50, ) # self.accommodation = self.find_or_make( # inv.Category, @@ -258,6 +272,17 @@ class Command(BaseCommand): order=90, ) + # Agreements + self.accept_terms = self.find_or_make( + inv.Product, + ("name","category",), + category = self.terms, + name="I Accept", + price=Decimal("00.00"), + reservation_duration=hours(24), + order=10, + limit_per_user=1, + ) # Penguin dinner self.penguin_adult = self.find_or_make( @@ -637,7 +662,23 @@ class Command(BaseCommand): self.extras, 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( + cond.CategoryFlag, + ("description", ), + description="Must Accept Terms", + condition=cond.FlagBase.DISABLE_IF_FALSE, + enabling_category = self.terms, + ) + needs_agreement.categories.set([ + self.extras, + self.t_shirt, + self.penguin_dinner, + self.pdns_category, + ]) + def populate_discounts(self): diff --git a/pinaxcon/registrasion/migrations/0008_remove_attendeeprofile_agreement.py b/pinaxcon/registrasion/migrations/0008_remove_attendeeprofile_agreement.py new file mode 100644 index 00000000..d35526fe --- /dev/null +++ b/pinaxcon/registrasion/migrations/0008_remove_attendeeprofile_agreement.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-10-01 08:14 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pinaxcon_registrasion', '0007_auto_20170930_1610'), + ] + + operations = [ + migrations.RemoveField( + model_name='attendeeprofile', + name='agreement', + ), + ] diff --git a/pinaxcon/registrasion/models.py b/pinaxcon/registrasion/models.py index db28ba26..91a05382 100644 --- a/pinaxcon/registrasion/models.py +++ b/pinaxcon/registrasion/models.py @@ -66,12 +66,6 @@ class AttendeeProfile(rego.AttendeeProfileBase): "Please fill in line 1 before filling line 2", )) - if not self.agreement: - errors.append(( - "agreement", - "Agreement to the terms and conditions and to the Code of Conduct is required.", - )) - if errors: raise ValidationError(dict(errors)) @@ -201,18 +195,6 @@ class AttendeeProfile(rego.AttendeeProfileBase): blank=True, ) - agreement = models.BooleanField( - blank=False, - help_text="I agree to the " - " " - "terms and conditions of attendance, and I have read, " - "understood, and agree to act according to the standards set " - "forth in our " - "" - "Code of Conduct." - ) - - past_lca = models.ManyToManyField( PastEvent, verbose_name="Which past linux.conf.au events have you attended?",