コード例 #1
0
ファイル: forms.py プロジェクト: cfpb/cfgov-refresh
    def save(self, commit=True):
        registration = ConferenceRegistration(
            govdelivery_code=self.govdelivery_code
        )

        details = dict(self.cleaned_data)
        email = details['email']

        registration.details = details

        if commit:
            # Subscribe this registrant to GovDelivery.
            self.govdelivery_subscribe(code=self.govdelivery_code, email=email)

            # Update their question response, if appropriate.
            if self.govdelivery_question_id and self.govdelivery_answer_id:
                self.govdelivery_question_response(
                    email=email,
                    question_id=self.govdelivery_question_id,
                    answer_id=self.govdelivery_answer_id
                )

            # Persist the registration to the database.
            registration.save()

        return registration
コード例 #2
0
ファイル: forms.py プロジェクト: zachurban/cfgov-refresh
    def save(self, commit=True):
        registration = ConferenceRegistration(
            govdelivery_code=self.govdelivery_code
        )

        details = dict(self.cleaned_data)
        email = details['email']

        registration.details = details

        if commit:
            # Subscribe this registrant to GovDelivery.
            self.govdelivery_subscribe(code=self.govdelivery_code, email=email)

            # Update their question response, if appropriate.
            if self.govdelivery_question_id and self.govdelivery_answer_id:
                self.govdelivery_question_response(
                    email=email,
                    question_id=self.govdelivery_question_id,
                    answer_id=self.govdelivery_answer_id
                )

            # Persist the registration to the database.
            registration.save()

        return registration
コード例 #3
0
ファイル: forms.py プロジェクト: sarayourfriend/cfgov-refresh
    def save(self, commit=True):
        registration = ConferenceRegistration(
            govdelivery_code=self.govdelivery_code)

        details = dict(self.cleaned_data)
        email = details['email']

        registration.details = details

        if commit:
            # Subscribe this registrant to GovDelivery.
            self.govdelivery_subscribe(code=self.govdelivery_code, email=email)

            # Persist the registration to the database.
            registration.save()

        return registration
コード例 #4
0
ファイル: forms.py プロジェクト: contolini/cfgov-refresh
    def save(self, commit=True):
        registration = ConferenceRegistration(
            govdelivery_code=self.govdelivery_code
        )

        details = dict(self.cleaned_data)
        email = details['email']

        registration.details = details

        if commit:
            # Subscribe this registrant to GovDelivery.
            self.govdelivery_subscribe(code=self.govdelivery_code, email=email)

            # Persist the registration to the database.
            registration.save()

        return registration
コード例 #5
0
 def make_capacity_registrants(self, govdelivery_code, attendee_type):
     registrant = ConferenceRegistration(
         govdelivery_code=govdelivery_code,
         details={'attendee_type': attendee_type})
     ConferenceRegistration.objects.bulk_create([registrant] *
                                                self.capacity)
コード例 #6
0
 def make_capacity_registrants(self, govdelivery_code):
     registrant = ConferenceRegistration(govdelivery_code=govdelivery_code)
     ConferenceRegistration.objects.bulk_create([registrant] *
                                                self.capacity)
コード例 #7
0
 def make_registrants(self, handler, count, code=None):
     code = code or handler.block_value['code']
     ConferenceRegistration.objects.bulk_create(
         [ConferenceRegistration(code=code)] * count)