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
1=== modified file 'awstrial/templates/contacts.html'
2--- awstrial/templates/contacts.html 2011-12-18 15:21:32 +0000
3+++ awstrial/templates/contacts.html 2011-12-21 16:15:27 +0000
4@@ -38,10 +38,13 @@
5 2. Agree to the terms of Service
6 </p>
7 <p>
8- <input class="checkbox" type="checkbox" name="opt_marketing" id="opt_marketing" onClick="document.getElementById('launchbtn').disabled=(document.getElementById('launchbtn').disabled)? false : true"/>
9- <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>,
10- the <a href=http://www.ubuntu.com/community/conduct>Ubuntu Code of Conduct</a>,
11- 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/>
12+ <input class="checkbox" type="checkbox" name="a" id="a" onClick="document.getElementById('launchbtn').disabled=(document.getElementById('a').checked)? false : true"/>
13+ <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
14+ the <a href=http://www.ubuntu.com/community/conduct>Ubuntu Code of Conduct</a>.</label><br/>
15+ </p>
16+ <p>
17+ <input class="checkbox" type="checkbox" name="opt_marketing" id="opt_marketing" />
18+ <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/>
19 </p>
20 <label for="launchbtn">3. Launch your instance.</label>
21 <p>After clicking 'Launch', your instance will start, and your hour will begin.</p>
22
23=== modified file 'awstrial/trial/tests.py'
24--- awstrial/trial/tests.py 2011-12-18 15:21:32 +0000
25+++ awstrial/trial/tests.py 2011-12-21 16:15:27 +0000
26@@ -201,7 +201,7 @@
27 def call_run_instance(self, campaign):
28 post_data = {
29 'config': 'default',
30- 'opt_marketing': 1,
31+ 'a': 1,
32 'launchbtn': 'Launch',
33 }
34 return self.client.post('/%s/run/' % campaign.name, post_data)
35
36=== modified file 'awstrial/trial/views.py'
37--- awstrial/trial/views.py 2011-12-18 15:21:32 +0000
38+++ awstrial/trial/views.py 2011-12-21 16:15:27 +0000
39@@ -71,14 +71,14 @@
40 # Now Check the campaign is running and has avaliability left.
41 if current_campaign.remaining() and (current_campaign.active):
42 if request.method == "POST":
43-
44- # This is both the disclaiming and marketing opt-in checkbox
45- opt_marketing = request.POST.get('opt_marketing', '')
46- if opt_marketing:
47- user = request.user.profile
48- user.opt_marketing = opt_marketing
49- user.save()
50-
51+ # opt_marketing = opt in for marketing mail, bool
52+ user = request.user.profile
53+ user.opt_marketing = request.POST.get('opt_marketing', '')
54+ user.save()
55+
56+ # a = disclaimer box
57+ a = request.POST.get('a', '')
58+ if a:
59 #try:
60 region = request.POST.get('region',None)
61 if region is not None:

Subscribers

People subscribed via source and target branches