Merge lp:~mhall119/awstrial/new_marketing_optin into lp:awstrial

Proposed by Michael Hall
Status: Merged
Approved by: Michael Hall
Approved revision: 277
Merged at revision: 277
Proposed branch: lp:~mhall119/awstrial/new_marketing_optin
Merge into: lp:awstrial
Diff against target: 61 lines (+16/-13)
3 files modified
awstrial/templates/contacts.html (+7/-4)
awstrial/trial/tests.py (+1/-1)
awstrial/trial/views.py (+8/-8)
To merge this branch: bzr merge lp:~mhall119/awstrial/new_marketing_optin
Reviewer Review Type Date Requested Status
Matthew Nuzum (community) Approve
Review via email: mp+86578@code.launchpad.net

Commit message

Go back to using separate checkboxes for usage agreement and marketing opt-in with new working from Sonia

Description of the change

Go back to using separate checkboxes for usage agreement and marketing opt-in with new working from Sonia

To post a comment you must log in.
Revision history for this message
Matthew Nuzum (newz) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'awstrial/templates/contacts.html'
--- awstrial/templates/contacts.html 2011-12-18 15:21:32 +0000
+++ awstrial/templates/contacts.html 2011-12-21 16:15:27 +0000
@@ -38,10 +38,13 @@
38 2. Agree to the terms of Service38 2. Agree to the terms of Service
39 </p>39 </p>
40 <p>40 <p>
41 <input class="checkbox" type="checkbox" name="opt_marketing" id="opt_marketing" onClick="document.getElementById('launchbtn').disabled=(document.getElementById('launchbtn').disabled)? false : true"/>41 <input class="checkbox" type="checkbox" name="a" id="a" onClick="document.getElementById('launchbtn').disabled=(document.getElementById('a').checked)? false : true"/>
42 <label for="a">I will use this instance in accordance with the <a href=http://aws.amazon.com/agreement/>Amazon Web Services Customer Agreement</a>,42 <label for="a">I will use this instance in accordance with the <a href=http://aws.amazon.com/agreement/>Amazon Web Services Customer Agreement</a> and
43 the <a href=http://www.ubuntu.com/community/conduct>Ubuntu Code of Conduct</a>,43 the <a href=http://www.ubuntu.com/community/conduct>Ubuntu Code of Conduct</a>.</label><br/>
44 and that Canonical may occasionally mail me information about products and services in accordance with our <a href="http://www.canonical.com/privacy">privacy policy</a>.</label><br/>44 </p>
45 <p>
46 <input class="checkbox" type="checkbox" name="opt_marketing" id="opt_marketing" />
47 <label for="opt_marketing">I want to receive Canonical's newsletter. My details will be handled in accordance with the Canonical <a href="http://www.canonical.com/legal">privacy policy</a>.</label><br/>
45 </p>48 </p>
46 <label for="launchbtn">3. Launch your instance.</label>49 <label for="launchbtn">3. Launch your instance.</label>
47 <p>After clicking 'Launch', your instance will start, and your hour will begin.</p>50 <p>After clicking 'Launch', your instance will start, and your hour will begin.</p>
4851
=== modified file 'awstrial/trial/tests.py'
--- awstrial/trial/tests.py 2011-12-18 15:21:32 +0000
+++ awstrial/trial/tests.py 2011-12-21 16:15:27 +0000
@@ -201,7 +201,7 @@
201 def call_run_instance(self, campaign):201 def call_run_instance(self, campaign):
202 post_data = {202 post_data = {
203 'config': 'default',203 'config': 'default',
204 'opt_marketing': 1,204 'a': 1,
205 'launchbtn': 'Launch',205 'launchbtn': 'Launch',
206 }206 }
207 return self.client.post('/%s/run/' % campaign.name, post_data)207 return self.client.post('/%s/run/' % campaign.name, post_data)
208208
=== modified file 'awstrial/trial/views.py'
--- awstrial/trial/views.py 2011-12-18 15:21:32 +0000
+++ awstrial/trial/views.py 2011-12-21 16:15:27 +0000
@@ -71,14 +71,14 @@
71 # Now Check the campaign is running and has avaliability left.71 # Now Check the campaign is running and has avaliability left.
72 if current_campaign.remaining() and (current_campaign.active):72 if current_campaign.remaining() and (current_campaign.active):
73 if request.method == "POST":73 if request.method == "POST":
7474 # opt_marketing = opt in for marketing mail, bool
75 # This is both the disclaiming and marketing opt-in checkbox75 user = request.user.profile
76 opt_marketing = request.POST.get('opt_marketing', '')76 user.opt_marketing = request.POST.get('opt_marketing', '')
77 if opt_marketing:77 user.save()
78 user = request.user.profile78
79 user.opt_marketing = opt_marketing79 # a = disclaimer box
80 user.save()80 a = request.POST.get('a', '')
8181 if a:
82 #try:82 #try:
83 region = request.POST.get('region',None)83 region = request.POST.get('region',None)
84 if region is not None:84 if region is not None:

Subscribers

People subscribed via source and target branches