Merge lp:~jonas-drange/ubuntu-webcatalog/tos-redirect into lp:ubuntu-webcatalog

Proposed by Jonas G. Drange
Status: Merged
Approved by: Jonas G. Drange
Approved revision: 193
Merged at revision: 190
Proposed branch: lp:~jonas-drange/ubuntu-webcatalog/tos-redirect
Merge into: lp:ubuntu-webcatalog
Diff against target: 198 lines (+24/-98)
7 files modified
django_project/config/main.cfg (+2/-0)
src/webcatalog/schema.py (+2/-0)
src/webcatalog/templates/webcatalog/tos.html (+0/-5)
src/webcatalog/templates/webcatalog/tos_plain.html (+0/-35)
src/webcatalog/templates/webcatalog/tos_snippet.html (+0/-47)
src/webcatalog/tests/test_views.py (+13/-6)
src/webcatalog/urls.py (+7/-5)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-webcatalog/tos-redirect
Reviewer Review Type Date Requested Status
Martin Albisetti (community) Approve
Review via email: mp+183977@code.launchpad.net

Commit message

redirects terms of service to u1 terms of service

Description of the change

Redirects terms of service to u1 terms of service

cat/tos -> u1/terms
cat/tos/plain -> u1/terms/embedded

To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/config/main.cfg'
2--- django_project/config/main.cfg 2013-09-03 08:45:45 +0000
3+++ django_project/config/main.cfg 2013-09-04 20:38:21 +0000
4@@ -93,6 +93,8 @@
5 convoy_root = ./src/webcatalog/static/
6 ubuntu_series_for_versions = series_for_versions
7 webapp_log_path = ./tmp/webapp.log
8+ubuntuone_tos_url = http://one.ubuntu.com/terms/
9+ubuntuone_tos_url_embedded = http://one.ubuntu.com/terms/embedded
10
11 [series_for_versions]
12 10.04 = lucid
13
14=== modified file 'src/webcatalog/schema.py'
15--- src/webcatalog/schema.py 2013-09-03 08:45:45 +0000
16+++ src/webcatalog/schema.py 2013-09-04 20:38:21 +0000
17@@ -79,6 +79,8 @@
18 default='./tmp/webapp.log')
19 log_format = schema.StringOption(
20 default='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
21+ ubuntuone_tos_url = schema.StringOption()
22+ ubuntuone_tos_url_embedded = schema.StringOption()
23
24 class google(schema.Section):
25 google_analytics_id = schema.StringOption()
26
27=== removed file 'src/webcatalog/templates/webcatalog/tos.html'
28--- src/webcatalog/templates/webcatalog/tos.html 2012-03-19 23:15:56 +0000
29+++ src/webcatalog/templates/webcatalog/tos.html 1970-01-01 00:00:00 +0000
30@@ -1,5 +0,0 @@
31-{% extends "webcatalog/base.html" %}
32-{% block title %}Ubuntu Software Centre Terms of Service{% endblock %}
33-{% block content %}
34-{% include "webcatalog/tos_snippet.html" %}
35-{% endblock %}
36
37=== removed file 'src/webcatalog/templates/webcatalog/tos_plain.html'
38--- src/webcatalog/templates/webcatalog/tos_plain.html 2012-03-19 23:15:56 +0000
39+++ src/webcatalog/templates/webcatalog/tos_plain.html 1970-01-01 00:00:00 +0000
40@@ -1,35 +0,0 @@
41-<html>
42-<head>
43-<style type="text/css">
44-body {
45- background: #eee;
46- font-family: 'Ubuntu Beta', UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
47- font-size: 14px;
48- line-height: 16px;
49- color: #333;
50- margin: 0;
51- padding: 10px;
52-}
53-#tos {
54- border: 1px solid gray;
55- background: #fff;
56- padding: 40px;
57-}
58-#tos h2 {
59- font-weight: normal;
60- font-size: 24px;
61- margin-bottom: 40px;
62-}
63-a {
64- color: #dd4814;
65- text-decoration: none;
66-}
67-a:hover {
68- text-decoration: underline;
69-}
70-</style>
71-</head>
72-<body>
73-{% include "webcatalog/tos_snippet.html" %}
74-</body>
75-</html>
76
77=== removed file 'src/webcatalog/templates/webcatalog/tos_snippet.html'
78--- src/webcatalog/templates/webcatalog/tos_snippet.html 2012-07-06 14:44:58 +0000
79+++ src/webcatalog/templates/webcatalog/tos_snippet.html 1970-01-01 00:00:00 +0000
80@@ -1,47 +0,0 @@
81-<div id="tos">
82-<div class="header">
83-<h2>Ubuntu Software Centre Terms of Service</h2>
84-</div>
85-<div class="description">
86-<p>The Ubuntu Software Centre service (the &ldquo;Software Centre&rdquo;) is a service integrated with the Ubuntu desktop providing a simple way for Ubuntu users to purchase and download applications and content (&ldquo;apps&rdquo;). The Software Centre is run by Canonical Group Ltd (&ldquo;Canonical&rdquo; or &ldquo;us&rdquo; or &ldquo;our&rdquo; or &ldquo;we&rdquo;), and we hope that you will use and enjoy it.</p>
87-
88-<p>This agreement (&ldquo;agreement&rdquo;) is a legal agreement covering access to and use of the Software Centre by you as an individual (&ldquo;you&rdquo; or &ldquo;your&rdquo;). Your use of the Software Centre will be governed by this agreement, along with the Software Centre privacy policy. Please read this agreement carefully before you purchase or download apps from the Software Centre. By purchasing or downloading apps using the Software Centre, you agree to become bound by the terms and conditions of this agreement.</p>
89-
90-<ol>
91- <li>Open source software. These terms do not limit or restrict your rights under any applicable open source software licenses. If the apps you download using the Software Centre are licensed under an open source license, only that license applies to such apps. With respect to apps under open source licences, you may be entitled to download a copy of the app source code, which you may download from our servers.</li>
92-
93- <li>Apps available without charge. Canonical and third parties make some apps available at no charge to you through the Software Centre. You may download and install these apps with or without a Software Centre account.</li>
94-
95- <li>Apps available for purchase.
96- <ol>
97- <li>Account. You must be at least 13 years old to use the Software Centre to purchase apps. If you are between age 13 and 18, you confirm that you have your parent's or legal guardian's consent to use Software Centre and that they have read and agreed to this agreement. You will be asked to use your Ubuntu Single Sign On account to make a purchase. If you do not have an Ubuntu Single Sign On account, you will need to create one. You are responsible for choosing an appropriate password for your Ubuntu Single Sign On account and for keeping it secure. Canonical representatives will not ask you for your password and you should not reveal it to anyone. Fees and payment. Payment for apps is due at the time you purchase the app. You will be asked to enter your credit card number and we will charge your credit card at the time of purchase. Fees are charged in the currency in which you make your purchase. All fees are non-refundable.</li>
98-
99- <li>Downloads. Immediately after you purchase an app, the app will be available for you to download through the Software Centre. You may re-download your app from the Software Centre until we stop providing the Software Centre or until the app is removed from the Software Centre.</li>
100-
101- </ol>
102- </li>
103- <li>App licenses. Each app you download or purchase is subject to the terms and conditions or license set by the app provider or developer, which may be presented to you at the time of download or contained in the app.</li>
104-
105-</ol>
106-<ol>
107- <li>Support. Third party app providers may offer support for their apps. Third party apps are not supported by Canonical.</li>
108-
109- <li>Acceptable use and conduct. All usage of the Software Centre must be legal and not infringe any third party's rights. You must not take any action or use the Software Centre in any way that might bring Canonical into disrepute, affect the ability of Canonical to provide the Software Centre, be illegal, or encourage illegal activities. You may not use the services in any manner that might be libellous or defamatory (more info on what <a href="https://www.eff.org/issues/bloggers/legal/liability/defamation">that means</a>), that contains threats or incites violence towards individuals or entities, or that violates the privacy or publicity rights of any third party. You shall indemnify Canonical in full for any loss, cost or damages suffered by it as a result of your use or misuse of the Software Centre.</li>
110-
111- <li>Changes to the Software Centre or this agreement. We aim to continually improve the Software Centre and, as a result, will make changes to it from time to time, including adding new features and modifying or discontinuing (temporarily or permanently) existing features, in part or in whole. We may occasionally change the terms of this agreement by posting an updated version, and all changes will go into effect at the time we post the updated agreement.</li>
112-
113- <li>Termination. You may terminate this agreement by stopping your use of the Software Centre at any time. We may terminate this agreement and your use of the Software Centre at any time if we are made aware that you are in breach of any term of this agreement or if we no longer make the Software Centre available.</li>
114-
115- <li>Collection and use of your data. We may collect certain non-personally-identifiable information, which is located on your computer. The information collected may include statistics relating to the types of apps you download, how often you download apps, and which apps you download. You agree this information may be retained and used by Canonical. Canonical may disclose any or all personal data and contents you have sent, posted or published if required to comply with applicable law or the order or requirement of a court, administrative agency or other governmental body. All other use of your personal data is subject to the Software Centre privacy policy.</li>
116-
117- <li>Third-party content. You may access third-party apps in your use of the Software Centre. You will not remove any third party's copyright notices or other identifier, except as allowed by the third-party's licence of that app. Canonical is not responsible for any app provided by any third party. Should you reasonably believe that any third-party app you access through the Software Centre is in breach of any law, regulation or third party's rights, you should notify Canonical in writing at the address below. In doing so, please:* identify the material which you believe to be infringing;* identify what you believe this material infringes and why;* provide your name, email address, address and telephone number;* confirm that you believe in good faith that this material is infringing a law or third party's rights and that, to the best of your knowledge, the information you are providing is correct;* identify if you are acting on behalf of the third party whose rights may have been infringed;provide your physical or electronic signature.</li>
118-
119- <li>Limitation of Liability. Software and services provided under this agreement are provided to you as is and with no warranties whatsoever. All implied warranties are excluded to the extent legally permissible. Under no circumstances will Canonical or its suppliers be liable to you for any consequential or indirect loss of profits or economic advantage. Canonical cannot guarantee the connection speed between you and the Software Centre and Canonical cannot be held liable for any direct or indirect damage or loss caused by connection speed. Canonical will use reasonable efforts to ensure availability of the Software Centre, but makes no guarantee that the Software Centre will be available without interruption. Canonical is not responsible for the loss of any of your data or any loss of business or financial disadvantage to you as a result of any loss of or damage to your data as a consequence of your use of the Software Centre. You should ensure that you have suitable backups of all data. These limitations of liability do not apply with respect to any death or personal injury as a consequence of the negligent act of Canonical, its employees, suppliers or licensors.</li>
120-
121- <li>General. This agreement is the entire agreement between you and Canonical with regard to the Software Centre. This agreement is governed by the laws of England and any dispute will be heard by the courts in England. Notwithstanding the immediately preceding sentence, if you are a citizen of the United States of America, Canada or Mexico (and not a citizen of the United Kingdom), and you are not accessing the service from the United Kingdom, then this agreement is governed by the laws of the State of New York (USA) and any dispute will be heard by the Federal and State courts located in the State of New York (USA). You may not assign this agreement, and any attempted assignment will be void from the beginning. Failure by Canonical to enforce any right or provision of this agreement shall not constitute a waiver of such right or provision. If any part of this agreement is held invalid or unenforceable, that part will be construed to reflect the parties&#146; original intent, and the remaining portions will remain in full force and effect. The terms of this agreement do not affect your statutory rights. Any notices should be sent by registered post to Canonical Group Ltd, 5th Floor, Blue Fin Building, 110 Southwark Street, London, England, SE1 0SU.</li>
122-</ol>
123-
124-<p>Last updated:&nbsp;March 13, 2012</p>
125-</div>
126-
127-</div>
128
129=== modified file 'src/webcatalog/tests/test_views.py'
130--- src/webcatalog/tests/test_views.py 2013-04-26 14:24:42 +0000
131+++ src/webcatalog/tests/test_views.py 2013-09-04 20:38:21 +0000
132@@ -28,6 +28,7 @@
133 from django.core import mail
134 from django.core.cache import cache
135 from django.core.urlresolvers import reverse
136+from django.http import HttpResponsePermanentRedirect
137 from django.test import TestCase
138
139 from mock import patch
140@@ -851,15 +852,21 @@
141
142 class TermsOfServiceTestCase(TestCase):
143
144- def test_tos_is_accessible(self):
145+ def test_tos_redirects(self):
146 response = self.client.get(reverse('wc-tos'))
147- self.assertTemplateUsed(response, 'webcatalog/tos.html')
148- self.assertTemplateUsed(response, 'webcatalog/tos_snippet.html')
149+ self.assertEqual(response.status_code, 301)
150+ self.assertTrue(isinstance(response,
151+ HttpResponsePermanentRedirect))
152+ self.assertEqual(response.get('location'),
153+ settings.UBUNTUONE_TOS_URL)
154
155- def test_tos_plain_is_accessible(self):
156+ def test_tos_plain_redirects(self):
157 response = self.client.get(reverse('wc-tos-plain'))
158- self.assertTemplateUsed(response, 'webcatalog/tos_plain.html')
159- self.assertTemplateUsed(response, 'webcatalog/tos_snippet.html')
160+ self.assertEqual(response.status_code, 301)
161+ self.assertTrue(isinstance(response,
162+ HttpResponsePermanentRedirect))
163+ self.assertEqual(response.get('location'),
164+ settings.UBUNTUONE_TOS_URL_EMBEDDED)
165
166
167 class OverviewTestCase(TestCaseWithFactory):
168
169=== modified file 'src/webcatalog/urls.py'
170--- src/webcatalog/urls.py 2013-02-28 16:23:58 +0000
171+++ src/webcatalog/urls.py 2013-09-04 20:38:21 +0000
172@@ -19,8 +19,9 @@
173
174 from __future__ import absolute_import
175
176+from django.conf import settings
177 from django.conf.urls.defaults import patterns, include, url
178-from django.views.generic import TemplateView
179+from django.views.generic import RedirectView, TemplateView
180
181 __metaclass__ = type
182 __all__ = [
183@@ -52,10 +53,11 @@
184 'application_recommends', name="wc-package-recommends"),
185 url(r'^search/$', 'search', name="wc-search"),
186 url(r'^search/(?P<distro>[-.+\w]+)/$', 'search', name="wc-search"),
187- url(r'^tos/$', name="wc-tos",
188- view=TemplateView.as_view(template_name="webcatalog/tos.html")),
189- url(r'^tos/plain/$', name="wc-tos-plain",
190- view=TemplateView.as_view(template_name="webcatalog/tos_plain.html")),
191+ url(r'^tos/$', RedirectView.as_view(url=settings.UBUNTUONE_TOS_URL),
192+ name="wc-tos"),
193+ url(r'^tos/plain/$',
194+ RedirectView.as_view(url=settings.UBUNTUONE_TOS_URL_EMBEDDED),
195+ name="wc-tos-plain"),
196 url(r'^combo/$', 'combo_view', name='wc-combo'),
197 url(r'^forbidden/$', 'forbidden', name='wc-forbidden'),
198 url(r'^tasks/$', 'tasks', name='wc-tasks'),

Subscribers

People subscribed via source and target branches