Merge ~cjwatson/launchpad:modern-ztk into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: ecf2fd6f9603113f5a58cb7bcd3b6da48947e8ff
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:modern-ztk
Merge into: launchpad:master
Diff against target: 743 lines (+196/-212)
18 files modified
constraints.txt (+155/-196)
lib/lp/app/browser/launchpadform.py (+12/-1)
lib/lp/app/doc/tales.txt (+1/-1)
lib/lp/app/stories/basics/xx-lowercase-redirection.txt (+1/-1)
lib/lp/bugs/stories/webservice/xx-bug-target.txt (+1/-1)
lib/lp/registry/browser/distributionmirror.py (+1/-0)
lib/lp/registry/browser/poll.py (+1/-0)
lib/lp/registry/browser/team.py (+1/-0)
lib/lp/scripts/helpers.py (+1/-1)
lib/lp/services/messaging/tests/test_rabbit.py (+1/-1)
lib/lp/services/verification/browser/logintoken.py (+1/-0)
lib/lp/services/webapp/doc/test_adapter.txt (+1/-1)
lib/lp/services/webapp/doc/webapp-authorization.txt (+1/-1)
lib/lp/services/webapp/doc/webapp-publication.txt (+2/-2)
lib/lp/services/webapp/publication.py (+6/-1)
lib/lp/services/webapp/session.py (+2/-3)
lib/lp/translations/browser/language.py (+1/-0)
setup.py (+7/-2)
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+376781@code.launchpad.net

Commit message

Upgrade ZTK packages to 2019-10-23 versions

Description of the change

We now maintain a branch of zope.session rather than freezing it at an old version, and we now track zope.app.* packages individually rather than via the long-gone zopeapp-versions.cfg.

A few things needed to change at the same time as this upgrade:

 * The signature of zope.formlib.form.checkInvariants changed to allow checking form invariants against contexts other than the form itself. For most of our forms this is reasonable, but it isn't suitable for a few of them, notably those that create new objects. To allow for that, I added a new LaunchpadFormView.invariant_context attribute, defaulting to the view's context but customisable by individual views.

 * transaction 2.0.1 removes ITransaction.setUser and places stricter requirements on ITransaction.user. Adjust for this.

 * We poke inside the implementation of transaction managers in a couple of places, and for those we need to adjust for the ThreadTransactionManager implementation change in transaction 2.4.0.

 * I upgraded launchpadlib to weaken its hosted-files test, which would otherwise fail with zope.publisher >= 4.2.2.

 * I weakened a test in xx-bug-target.txt due to changes in zope.schema 4.6.0, as described in https://github.com/zopefoundation/zope.schema/pull/85. This isn't entirely ideal, but we can live with the error messages here being a bit ugly until we come up with something better.

 * A few minor details of things like rendering and exception arguments changed.

The new dependencies are in https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/376770.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

Nicely done, just one thing...

review: Approve (code)
~cjwatson/launchpad:modern-ztk updated
ecf2fd6... by Colin Watson

Document odd txn.user syntax

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/constraints.txt b/constraints.txt
index 94b80d3..a4985d1 100644
--- a/constraints.txt
+++ b/constraints.txt
@@ -1,197 +1,162 @@
1# ztk-versions.cfg from ZTK 1.1.6, with some upgrades1# ztk-versions.cfg from ZTK a9eb2093b5 (2019-10-23), with some upgrades
2# ---------------------------------------------------2# ---------------------------------------------------------------------
33
4zope.annotation==3.6.04zope.annotation==4.7.0
5zope.applicationcontrol==3.5.55zope.applicationcontrol==4.2.0
6zope.authentication==3.7.16zope.authentication==4.4.0
7zope.broken==3.6.07zope.browser==2.3
8zope.browser==1.38zope.browsermenu==4.4
9zope.browsermenu==3.9.19zope.browserpage==4.3.0
10zope.browserpage==3.12.210zope.browserresource==4.3
11zope.browserresource==3.12.011zope.cachedescriptors==4.3.1
12zope.cachedescriptors==3.5.112zope.catalog==4.2.1
13zope.catalog==3.8.2
14#zope.component==3.10.0
15# Tell pip about extras to work around https://github.com/pypa/pip/issues/304613# Tell pip about extras to work around https://github.com/pypa/pip/issues/3046
16# XXX cjwatson 2017-09-03: This should be fixed in pip 9.0.0, but apparently14# XXX cjwatson 2017-09-03: This should be fixed in pip 9.0.0, but apparently
17# isn't.15# isn't.
18# Upgrade from ZTK 1.1.6 for ZCML registration performance.16zope.component[hook,zcml]==4.5
19zope.component[hook,zcml]==3.11.017zope.componentvocabulary==2.2.0
20zope.componentvocabulary==1.0.118zope.configuration==4.3.1
21zope.configuration==3.7.419zope.container==4.2.2
22zope.container==3.12.020zope.contentprovider==4.2.1
23zope.contentprovider==3.7.221zope.contenttype==4.4
24zope.contenttype==3.5.522zope.copy==4.2
25zope.copy==3.5.023zope.copypastemove==4.1.0
26zope.copypastemove==3.8.024zope.datetime==4.2.0
27zope.datetime==3.4.125zope.deferredimport==4.3
28zope.deferredimport==3.5.326zope.deprecation==4.4.0
29zope.deprecation==3.4.127zope.dottedname==4.3
30zope.dottedname==3.4.628zope.dublincore==4.2.0
31zope.dublincore==3.8.229zope.error==4.5.0
32zope.error==3.7.430zope.event==4.4
33zope.event==3.5.231zope.exceptions==4.3
34zope.exceptions==3.6.232zope.filerepresentation==4.2.0
35zope.filerepresentation==3.6.133zope.formlib==4.6.0
36zope.formlib==4.0.634zope.hookable==4.2.0
37zope.hookable==3.4.135zope.i18n==4.6.2
38#zope.i18n==3.7.436zope.i18nmessageid==4.3.1
39zope.i18n==4.3.137zope.index==4.4.0
40zope.i18nmessageid==3.5.338zope.interface==4.6.0
41zope.index==3.6.439zope.intid==4.3.0
42#zope.interface==3.7.040zope.keyreference==4.2.0
43# Upgrade from ZTK 1.1.6 for ZCML registration performance.41zope.lifecycleevent==4.3
44zope.interface==4.4.342zope.location==4.2
45zope.intid==3.7.243zope.login==2.1.0
46zope.keyreference==3.6.444zope.mimetype==2.4.0
47zope.lifecycleevent==3.6.245zope.minmax==2.2.0
48zope.location==3.9.146zope.pagetemplate==4.4.1
49zope.login==1.0.047zope.password==4.3.1
50zope.mimetype==1.3.148zope.pluggableauth==2.3.0
51zope.minmax==1.1.249zope.principalannotation==4.3.0
52#zope.pagetemplate==3.5.250zope.principalregistry==4.2.0
53zope.pagetemplate==4.3.051zope.processlifetime==2.3.0
54zope.password==3.6.152zope.proxy==4.3.1
55zope.pluggableauth==1.253zope.ptresource==4.2.0
56zope.principalannotation==3.6.154zope.publisher==5.0.1
57zope.principalregistry==3.7.155zope.ramcache==2.3
58zope.processlifetime==1.056zope.schema==4.9.3
59zope.proxy==3.6.157zope.security==4.3.1
60zope.ptresource==3.9.058zope.securitypolicy==4.3.1
61zope.publisher==3.12.659zope.sendmail==5.0
62zope.ramcache==1.060#zope.session==4.3.0
63zope.schema==3.7.161# lp:~launchpad-committers/zope.session:launchpad
64zope.security==3.8.362zope.session==4.3.0+lp1
65zope.securitypolicy==3.7.063zope.site==4.2.2
66zope.sendmail==3.7.564zope.size==4.3
67zope.sequencesort==3.4.065zope.structuredtext==4.3
68zope.server==3.8.666zope.tal==4.4
69#zope.session==3.9.567zope.tales==5.0
70# XXX: downgraded to avoid 3.9.2 cookie calculation changes
71zope.session==3.9.1
72zope.site==3.9.2
73zope.size==3.4.1
74zope.structuredtext==3.5.1
75#zope.tal==3.5.2
76zope.tal==4.3.0
77zope.tales==3.5.3
78#zope.testing==3.10.3
79zope.testing==4.768zope.testing==4.7
80#zope.testrunner==4.0.469#zope.testrunner==5.0
81# lp:~launchpad-committers/zope.testrunner:launchpad70# lp:~launchpad-committers/zope.testrunner:launchpad
82zope.testrunner[subunit]==5.1+lp271zope.testrunner[subunit]==5.1+lp2
83zope.traversing==3.14.072zope.traversing==4.3.1
84zope.viewlet==3.7.273zope.viewlet==4.2.1
8574
86# Deprecating75# Direct dependencies
76BTrees==4.5.1
77persistent==4.4.3
78python-gettext==4.0
79pytz==2018.9
80setuptools==41.0.0
81six==1.12.0
82transaction==2.4.0
8783
88# Dependencies84# zope.password needs these
89#distribute==0.6.3685bcrypt==3.1.6
90distribute==0.7.386cffi==1.12.2
91#docutils==0.787pycparser==2.19
92docutils==0.1488
93Jinja2==2.5.589# Python2-only
94mechanize==0.2.590zope.untrustedpython==4.0.0
95Paste==1.7.5.191# Required by zope.untrustedpython
96PasteDeploy==1.3.4
97PasteScript==1.7.5
98py==1.4.8
99#Pygments==1.4
100Pygments==2.2.0
101#python-gettext==1.0
102python-gettext==3.0
103#python-subunit==0.0.7
104python-subunit==1.3.0
105#pytz==2014.10
106pytz==2017.2
107RestrictedPython==3.6.092RestrictedPython==3.6.0
108#setuptools==0.6c1193
109setuptools==36.4.094# Testing dependencies
110#Sphinx==1.0.895ZConfig==3.4.0
111Sphinx==1.6.596ZODB==5.5.1
112#testtools==0.9.1297argparse==1.4.0
98colorama==0.4.1
99extras==1.0.0
100fixtures==3.0.0
101linecache2==1.0.0
102manuel==1.10.1
103pbr==5.1.3
104pyparsing==2.4.0
105python-mimeparse==1.6.0
106python-subunit==1.3.0
113testtools==2.3.0107testtools==2.3.0
114transaction==1.1.1108traceback2==1.4.0
115z3c.recipe.sphinxdoc==0.0.8109unittest2==1.1.0
116zc.buildout==1.7.1110zc.lockfile==1.4
117zc.lockfile==1.0.2111zdaemon==4.3
118#ZConfig==2.8.0112zodbpickle==1.0.3
119ZConfig==2.9.1dev-20110728
120zc.recipe.egg==1.3.2
121zc.recipe.testrunner==1.4.0
122zc.resourcelibrary==1.3.4
123zdaemon==2.0.7
124ZODB3==3.10.5
125zope.mkzeoinstance==3.9.5
126113
127# toolchain
128#argparse==1.1
129argparse==1.2.1
130coverage==3.5.2
131lxml==2.2.8
132mr.developer==1.25
133nose==1.1.2
134tl.eggdeps==0.4
135z3c.checkversions==0.4.1
136z3c.recipe.compattest==0.13.1
137z3c.recipe.depgraph==0.5
138z3c.recipe.scripts==1.0.1
139zope.kgs==1.2.0
140114
141# zopeapp-versions.cfg from ZTK 1.1.6, with some upgrades115# Testing tools
142# -------------------------------------------------------116coverage==4.5.3
117nose==1.3.7
143118
144# ZopeApp119# Documentation dependencies
145zc.sourcefactory==0.7.0120# We have to keep a version < 2 to still support Python 2
146zope.app.applicationcontrol==3.5.10121Sphinx==1.8.5
147zope.app.appsetup==3.15.0122docutils==0.14
148zope.app.debug==3.4.1123imagesize==1.1.0
149zope.app.http==3.9.0124alabaster==0.7.12
150zope.app.publication==3.12.0125babel==2.6.0
151#zope.app.wsgi==3.10.0126Jinja2==2.10.1
152zope.app.wsgi==3.15.0127MarkupSafe==1.1.1
153#zope.testbrowser==3.10.4128Pygments==2.3.1
154zope.testbrowser[wsgi]==5.5.1129snowballstemmer==1.2.1
130lxml==4.4.1
131repoze.sphinx.autointerface==0.8
132#requests==2.21.0
133requests==2.22.0
134certifi==2019.3.9
135#urllib3==1.24.1
136urllib3==1.25.3
137idna==2.8
138chardet==3.0.4
139sphinxcontrib-programoutput==0.14
140sphinxcontrib-websupport==1.1.0
141sphinx-rtd-theme==0.4.3
142packaging==19.0
143typing==3.6.6
144z3c.recipe.sphinxdoc==1.1.0
155145
156# Deprecated146# ZTK buildout dependencies
157roman==1.4.0147collective.recipe.cmd==0.11
158#wsgi-intercept==0.4148mr.developer==2.0.0
159# Upgrade from ZTK 1.1.5 to intercept lazr.restfulclient.149z3c.checkversions==1.1
160wsgi-intercept==0.5.1150z3c.recipe.compattest==1.0
161zope.app.authentication==3.9.0151zc.buildout==2.13.1
162zope.app.basicskin==3.5.1152zc.recipe.egg==2.0.7
163zope.app.broken==3.6.0153zc.recipe.testrunner==2.0.0
164zope.app.component==3.9.3
165zope.app.container==3.9.2
166zope.app.content==3.5.1
167zope.app.dependable==3.5.1
168zope.app.error==3.5.3
169zope.app.exception==3.6.3
170zope.app.folder==3.5.2
171zope.app.form==4.0.2
172zope.app.generations==3.7.1
173zope.app.i18n==3.6.4
174zope.app.locales==3.6.2
175zope.app.localpermission==3.7.2
176zope.app.pagetemplate==3.11.2
177zope.app.principalannotation==3.7.0
178zope.app.publisher==3.10.2
179zope.app.renderer==3.5.1
180zope.app.rotterdam==3.5.3
181zope.app.schema==3.5.0
182zope.app.security==3.7.5
183#zope.app.testing==3.8.1
184zope.app.testing==3.10.0
185zope.app.zcmlfiles==3.7.1
186zope.app.zopeappgenerations==3.6.1
187zope.generations==3.7.1
188154
189# Launchpad155# Launchpad
190# ---------156# ---------
191157
192# Alphabetical, case-insensitive, please! :-)158# Alphabetical, case-insensitive, please! :-)
193159
194alabaster==0.7.10
195# lp:~launchpad/ampoule/lp160# lp:~launchpad/ampoule/lp
196# post1 Don't add a process back to the ready set if it received an error161# post1 Don't add a process back to the ready set if it received an error
197# such as a timeout.162# such as a timeout.
@@ -208,7 +173,6 @@ Automat==0.6.0
208Babel==2.5.1173Babel==2.5.1
209backports.functools-lru-cache==1.5174backports.functools-lru-cache==1.5
210backports.lzma==0.0.3175backports.lzma==0.0.3
211bcrypt==3.1.4
212BeautifulSoup==3.2.1176BeautifulSoup==3.2.1
213beautifulsoup4[lxml]==4.7.1177beautifulsoup4[lxml]==4.7.1
214billiard==3.5.0.5178billiard==3.5.0.5
@@ -216,10 +180,7 @@ bson==0.3.3
216# lp:~launchpad/bzr/lp180# lp:~launchpad/bzr/lp
217bzr==2.6.0.lp.4181bzr==2.6.0.lp.4
218celery==4.1.1182celery==4.1.1
219certifi==2019.3.9
220cffi==1.11.2
221Chameleon==2.11183Chameleon==2.11
222chardet==3.0.4
223constantly==15.1.0184constantly==15.1.0
224cookies==2.2.1185cookies==2.2.1
225cryptography==2.7186cryptography==2.7
@@ -235,10 +196,8 @@ dulwich==0.18.6
235elementtree==1.2.6-20050316196elementtree==1.2.6-20050316
236enum34==1.1.6197enum34==1.1.6
237epydoc==3.0.1198epydoc==3.0.1
238extras==1.0.0
239feedparser==5.2.1199feedparser==5.2.1
240feedvalidator==0.0.0DEV-r1049200feedvalidator==0.0.0DEV-r1049
241fixtures==3.0.0
242FormEncode==1.2.4201FormEncode==1.2.4
243futures==3.2.0202futures==3.2.0
244geoip2==2.9.0203geoip2==2.9.0
@@ -247,8 +206,6 @@ gunicorn==19.8.1
247html5browser==0.0.9206html5browser==0.0.9
248httplib2==0.8207httplib2==0.8
249hyperlink==18.0.0208hyperlink==18.0.0
250idna==2.6
251imagesize==0.7.1
252importlib==1.0.2209importlib==1.0.2
253importlib-resources==0.5210importlib-resources==0.5
254incremental==17.5.0211incremental==17.5.0
@@ -259,7 +216,7 @@ jsautobuild==0.2
259keyring==0.6.2216keyring==0.6.2
260kombu==4.4.0217kombu==4.4.0
261launchpad-buildd==159218launchpad-buildd==159
262launchpadlib==1.10.7219launchpadlib==1.10.9
263lazr.authentication==0.1.1220lazr.authentication==0.1.1
264lazr.batchnavigator==1.3.0221lazr.batchnavigator==1.3.0
265lazr.config==2.2.2222lazr.config==2.2.2
@@ -275,7 +232,6 @@ lazr.uri==1.0.3
275libnacl==1.3.6232libnacl==1.3.6
276lpjsmin==0.5233lpjsmin==0.5
277m2r==0.1.13234m2r==0.1.13
278manuel==1.7.2
279Markdown==2.3.1235Markdown==2.3.1
280martian==0.11236martian==0.11
281maxminddb==1.5.1237maxminddb==1.5.1
@@ -294,15 +250,16 @@ oops-wsgi==0.0.8
294ordereddict==1.1250ordereddict==1.1
295oslo.config==1.3.0251oslo.config==1.3.0
296paramiko==2.4.1252paramiko==2.4.1
253Paste==1.7.5.1
254PasteDeploy==1.3.4
255PasteScript==1.7.5
297pathlib2==2.3.2256pathlib2==2.3.2
298pbr==0.11.1
299pgbouncer==0.0.8257pgbouncer==0.0.8
300prettytable==0.7.2258prettytable==0.7.2
301psutil==5.4.2259psutil==5.4.2
302psycopg2==2.7.4260psycopg2==2.7.4
303pyasn1==0.4.2261pyasn1==0.4.2
304pyasn1-modules==0.2.1262pyasn1-modules==0.2.1
305pycparser==2.18
306# lp:~launchpad/pygpgme/pthread263# lp:~launchpad/pygpgme/pthread
307# lp1 Link against libgpgme-pthread for thread-safety.264# lp1 Link against libgpgme-pthread for thread-safety.
308pygpgme==0.3+lp1265pygpgme==0.3+lp1
@@ -316,7 +273,6 @@ python-dateutil==1.5
316python-debian==0.1.32273python-debian==0.1.32
317python-keystoneclient==0.7.1274python-keystoneclient==0.7.1
318python-memcached==1.58275python-memcached==1.58
319python-mimeparse==0.1.4
320# XXX: deryck 2012-08-10276# XXX: deryck 2012-08-10
321# See lp:~deryck/python-openid/python-openid-fix1034376 which277# See lp:~deryck/python-openid/python-openid-fix1034376 which
322# reapplied a patch from wgrant to get codehosting going again.278# reapplied a patch from wgrant to get codehosting going again.
@@ -324,7 +280,6 @@ python-openid==2.2.5-fix1034376
324python-swiftclient==2.0.3280python-swiftclient==2.0.3
325PyYAML==3.10281PyYAML==3.10
326rabbitfixture==0.4.2282rabbitfixture==0.4.2
327requests==2.22.0
328requests-file==1.4.3283requests-file==1.4.3
329requests-toolbelt==0.9.1284requests-toolbelt==0.9.1
330responses==0.9.0285responses==0.9.0
@@ -335,11 +290,8 @@ setuptools-git==1.2
335setuptools-scm==1.15.7290setuptools-scm==1.15.7
336simplejson==3.8.2291simplejson==3.8.2
337SimpleTAL==4.3292SimpleTAL==4.3
338six==1.12.0
339snowballstemmer==1.2.1
340soupmatchers==0.4293soupmatchers==0.4
341soupsieve==1.9294soupsieve==1.9
342sphinxcontrib-websupport==1.0.1
343# lp:~launchpad-committers/storm/lp295# lp:~launchpad-committers/storm/lp
344storm==0.21.0.99+lp413296storm==0.21.0.99+lp413
345subprocess32==3.2.6297subprocess32==3.2.6
@@ -352,9 +304,6 @@ Twisted[conch,tls]==19.2.1
352txAMQP==0.6.2304txAMQP==0.6.2
353txfixtures==0.4.2305txfixtures==0.4.2
354txpkgupload==0.2306txpkgupload==0.2
355typing==3.6.2
356unittest2==1.1.0
357urllib3==1.25.3
358van.testing==3.0.0307van.testing==3.0.0
359vine==1.1.4308vine==1.1.4
360virtualenv-tools3==2.0.0309virtualenv-tools3==2.0.0
@@ -363,12 +312,22 @@ waitress==1.3.1
363WebOb==1.8.5312WebOb==1.8.5
364WebTest==2.0.33313WebTest==2.0.33
365wheel==0.29.0314wheel==0.29.0
315wsgi-intercept==0.5.1
366WSGIProxy2==0.4.6316WSGIProxy2==0.4.6
367wsgiref==0.1.2317wsgiref==0.1.2
368z3c.pt==2.2.3318z3c.pt==2.2.3
369z3c.ptcompat==0.5.7319z3c.ptcompat==0.5.7
370zc.zservertracelog==1.3.2320zc.zservertracelog==1.3.2
371# Not in ZTK 1.1.5321zope.app.applicationcontrol==4.0.0
372zope.app.server==3.6.0322zope.app.appsetup==4.1.0
373# Not in ZTK 1.1.5 (extracted from zope.app.schema)323zope.app.debug==3.4.1
324zope.app.dependable==3.5.1
325zope.app.http==4.0.1
326zope.app.pagetemplate==3.11.2
327zope.app.publication==4.3.1
328zope.app.publisher==3.10.2
329zope.app.server==4.0.0
330zope.app.wsgi[testlayer]==4.1.0
331zope.server==3.8.6
332zope.testbrowser==5.5.1
374zope.vocabularyregistry==1.0.0333zope.vocabularyregistry==1.0.0
diff --git a/lib/lp/app/browser/launchpadform.py b/lib/lp/app/browser/launchpadform.py
index e676414..ac6dd15 100644
--- a/lib/lp/app/browser/launchpadform.py
+++ b/lib/lp/app/browser/launchpadform.py
@@ -227,6 +227,16 @@ class LaunchpadFormView(LaunchpadView):
227 return {}227 return {}
228228
229 @property229 @property
230 def invariant_context(self):
231 """The context against which to check form invariants.
232
233 If None, invariants will only be checked against values in the form
234 itself. This is useful for forms that create new objects, since
235 their context may not be adaptable to their schema.
236 """
237 return self.context
238
239 @property
230 def action_url(self):240 def action_url(self):
231 """Set the default action URL for the form."""241 """Set the default action URL for the form."""
232242
@@ -320,7 +330,8 @@ class LaunchpadFormView(LaunchpadView):
320 widgets = form.Widgets(widgets, len(self.prefix) + 1)330 widgets = form.Widgets(widgets, len(self.prefix) + 1)
321 for error in form.getWidgetsData(widgets, self.prefix, data):331 for error in form.getWidgetsData(widgets, self.prefix, data):
322 self.errors.append(error)332 self.errors.append(error)
323 for error in form.checkInvariants(self.form_fields, data):333 for error in form.checkInvariants(
334 self.form_fields, data, self.invariant_context):
324 self.addError(error)335 self.addError(error)
325 return self.errors336 return self.errors
326337
diff --git a/lib/lp/app/doc/tales.txt b/lib/lp/app/doc/tales.txt
index 265ca25..cc7606e 100644
--- a/lib/lp/app/doc/tales.txt
+++ b/lib/lp/app/doc/tales.txt
@@ -1379,7 +1379,7 @@ Queries about permissions that don't exist will raise an exception:
1379 >>> test_tales('person/required:mushroom.Badger', person=mark)1379 >>> test_tales('person/required:mushroom.Badger', person=mark)
1380 Traceback (most recent call last):1380 Traceback (most recent call last):
1381 ...1381 ...
1382 ValueError: ('Undefined permission id', 'mushroom.Badger')1382 ValueError: ('Undefined permission ID', 'mushroom.Badger')
13831383
13841384
1385The somevalue/enumvalue:ENUMVALUE helper1385The somevalue/enumvalue:ENUMVALUE helper
diff --git a/lib/lp/app/stories/basics/xx-lowercase-redirection.txt b/lib/lp/app/stories/basics/xx-lowercase-redirection.txt
index bd29394..41c3e40 100644
--- a/lib/lp/app/stories/basics/xx-lowercase-redirection.txt
+++ b/lib/lp/app/stories/basics/xx-lowercase-redirection.txt
@@ -34,4 +34,4 @@ When doing a POST to an invalid URL, we get an error:
34 ... """)34 ... """)
35 HTTP/1.1 500 Internal Server Error35 HTTP/1.1 500 Internal Server Error
36 ...36 ...
37 </ul>POSTToNonCanonicalURL...37 </ul><p>POSTToNonCanonicalURL...
diff --git a/lib/lp/bugs/stories/webservice/xx-bug-target.txt b/lib/lp/bugs/stories/webservice/xx-bug-target.txt
index f0e1076..b49afd2 100644
--- a/lib/lp/bugs/stories/webservice/xx-bug-target.txt
+++ b/lib/lp/bugs/stories/webservice/xx-bug-target.txt
@@ -111,7 +111,7 @@ Official tags must conform to the same format as ordinary tags.
111 ... tag='an invalid tag !!!'))111 ... tag='an invalid tag !!!'))
112 HTTP/1.1 400 Bad Request112 HTTP/1.1 400 Bad Request
113 ...113 ...
114 tag: an invalid tag !!!114 tag: ...an invalid tag !!!...
115115
116We can also access official tags as a list.116We can also access official tags as a list.
117117
diff --git a/lib/lp/registry/browser/distributionmirror.py b/lib/lp/registry/browser/distributionmirror.py
index f13cc5e..fd671a0 100644
--- a/lib/lp/registry/browser/distributionmirror.py
+++ b/lib/lp/registry/browser/distributionmirror.py
@@ -211,6 +211,7 @@ class DistributionMirrorAddView(LaunchpadFormView):
211 "ftp_base_url", "rsync_base_url", "speed", "country", "content",211 "ftp_base_url", "rsync_base_url", "speed", "country", "content",
212 "official_candidate",212 "official_candidate",
213 ]213 ]
214 invariant_context = None
214215
215 @property216 @property
216 def label(self):217 def label(self):
diff --git a/lib/lp/registry/browser/poll.py b/lib/lp/registry/browser/poll.py
index c75a204..83d92b8 100644
--- a/lib/lp/registry/browser/poll.py
+++ b/lib/lp/registry/browser/poll.py
@@ -396,6 +396,7 @@ class PollAddView(LaunchpadFormView):
396 schema = IPoll396 schema = IPoll
397 field_names = ["name", "title", "proposition", "allowspoilt", "dateopens",397 field_names = ["name", "title", "proposition", "allowspoilt", "dateopens",
398 "datecloses"]398 "datecloses"]
399 invariant_context = None
399400
400 page_title = 'New poll'401 page_title = 'New poll'
401402
diff --git a/lib/lp/registry/browser/team.py b/lib/lp/registry/browser/team.py
index 5a79d28..ba79b6c 100644
--- a/lib/lp/registry/browser/team.py
+++ b/lib/lp/registry/browser/team.py
@@ -999,6 +999,7 @@ class TeamAddView(TeamFormMixin, HasRenewalPolicyMixin, LaunchpadFormView):
999 """View for adding a new team."""999 """View for adding a new team."""
10001000
1001 schema = ITeam1001 schema = ITeam
1002 invariant_context = None
1002 page_title = 'Register a new team in Launchpad'1003 page_title = 'Register a new team in Launchpad'
1003 label = page_title1004 label = page_title
10041005
diff --git a/lib/lp/scripts/helpers.py b/lib/lp/scripts/helpers.py
index 38583a6..a534c6c 100644
--- a/lib/lp/scripts/helpers.py
+++ b/lib/lp/scripts/helpers.py
@@ -78,7 +78,7 @@ class TransactionFreeOperation:
7878
79 @staticmethod79 @staticmethod
80 def any_active_transactions():80 def any_active_transactions():
81 return transaction.manager._txn81 return transaction.manager.manager._txn
8282
83 @classmethod83 @classmethod
84 def __enter__(cls):84 def __enter__(cls):
diff --git a/lib/lp/services/messaging/tests/test_rabbit.py b/lib/lp/services/messaging/tests/test_rabbit.py
index ae5a89c..6cd9f99 100644
--- a/lib/lp/services/messaging/tests/test_rabbit.py
+++ b/lib/lp/services/messaging/tests/test_rabbit.py
@@ -391,7 +391,7 @@ class TestRabbit(RabbitTestCase):
391391
392 def get_synced_sessions(self):392 def get_synced_sessions(self):
393 try:393 try:
394 syncs_set = transaction.manager._synchs394 syncs_set = transaction.manager.manager._synchs
395 except KeyError:395 except KeyError:
396 return set()396 return set()
397 else:397 else:
diff --git a/lib/lp/services/verification/browser/logintoken.py b/lib/lp/services/verification/browser/logintoken.py
index b17c6b8..c15321d 100644
--- a/lib/lp/services/verification/browser/logintoken.py
+++ b/lib/lp/services/verification/browser/logintoken.py
@@ -175,6 +175,7 @@ class ClaimTeamView(
175 field_names = [175 field_names = [
176 'teamowner', 'display_name', 'description', 'membership_policy',176 'teamowner', 'display_name', 'description', 'membership_policy',
177 'defaultmembershipperiod', 'renewal_policy', 'defaultrenewalperiod']177 'defaultmembershipperiod', 'renewal_policy', 'defaultrenewalperiod']
178 invariant_context = None
178 label = 'Claim Launchpad team'179 label = 'Claim Launchpad team'
179 custom_widget_description = CustomWidgetFactory(180 custom_widget_description = CustomWidgetFactory(
180 TextAreaWidget, height=10, width=30)181 TextAreaWidget, height=10, width=30)
diff --git a/lib/lp/services/webapp/doc/test_adapter.txt b/lib/lp/services/webapp/doc/test_adapter.txt
index 2adc5fe..656e4b1 100644
--- a/lib/lp/services/webapp/doc/test_adapter.txt
+++ b/lib/lp/services/webapp/doc/test_adapter.txt
@@ -367,7 +367,7 @@ transaction will be doomed:
367 >>> transaction.commit()367 >>> transaction.commit()
368 Traceback (most recent call last):368 Traceback (most recent call last):
369 ...369 ...
370 DoomedTransaction370 DoomedTransaction: transaction doomed, cannot commit
371 <BLANKLINE>371 <BLANKLINE>
372372
373Cleanup:373Cleanup:
diff --git a/lib/lp/services/webapp/doc/webapp-authorization.txt b/lib/lp/services/webapp/doc/webapp-authorization.txt
index 0a116c8..7269cbd 100644
--- a/lib/lp/services/webapp/doc/webapp-authorization.txt
+++ b/lib/lp/services/webapp/doc/webapp-authorization.txt
@@ -25,7 +25,7 @@ If the permission doesn't exist, it raises an error:
25 >>> check_permission('mushroom.Badger', sample_person)25 >>> check_permission('mushroom.Badger', sample_person)
26 Traceback (most recent call last):26 Traceback (most recent call last):
27 ...27 ...
28 ValueError: ('Undefined permission id', 'mushroom.Badger')28 ValueError: ('Undefined permission ID', 'mushroom.Badger')
29 >>> logout()29 >>> logout()
3030
3131
diff --git a/lib/lp/services/webapp/doc/webapp-publication.txt b/lib/lp/services/webapp/doc/webapp-publication.txt
index 2c2c608..5028368 100644
--- a/lib/lp/services/webapp/doc/webapp-publication.txt
+++ b/lib/lp/services/webapp/doc/webapp-publication.txt
@@ -872,8 +872,8 @@ The user attribute is an empty string, when no user is logged in.
872 >>> request._publication_start = 1.345872 >>> request._publication_start = 1.345
873 >>> request._publication_thread_start = None873 >>> request._publication_thread_start = None
874 >>> publication.afterCall(request, None)874 >>> publication.afterCall(request, None)
875 >>> txn.user875 >>> print txn.user
876 ''876 <BLANKLINE>
877877
878But if there is a logged in user, the transaction user attribute will878But if there is a logged in user, the transaction user attribute will
879contain its ID (as well as an empty '/' path, which is a Zope artefact879contain its ID (as well as an empty '/' path, which is a Zope artefact
diff --git a/lib/lp/services/webapp/publication.py b/lib/lp/services/webapp/publication.py
index 716dd2e..1a1c1a4 100644
--- a/lib/lp/services/webapp/publication.py
+++ b/lib/lp/services/webapp/publication.py
@@ -219,7 +219,12 @@ class LaunchpadBrowserPublication(
219 # It is possible that request.principal is None if the principal has219 # It is possible that request.principal is None if the principal has
220 # not been set yet.220 # not been set yet.
221 if request.principal is not None:221 if request.principal is not None:
222 txn.setUser(request.principal.id)222 # Zope sets the transaction's user attribute to a
223 # space-separated pair of path and user ID, where the path is a
224 # record of traversed objects. This is mostly a ZODB thing that
225 # we don't care about, so just use something minimal that fits
226 # the syntax.
227 txn.user = u"/ %s" % (request.principal.id,)
223228
224 return txn229 return txn
225230
diff --git a/lib/lp/services/webapp/session.py b/lib/lp/services/webapp/session.py
index 2d7161d..2861dec 100644
--- a/lib/lp/services/webapp/session.py
+++ b/lib/lp/services/webapp/session.py
@@ -51,6 +51,8 @@ class LaunchpadCookieClientIdManager(CookieClientIdManager):
51 # It should be larger than our session expiry time.51 # It should be larger than our session expiry time.
52 self.cookieLifetime = 1 * YEARS52 self.cookieLifetime = 1 * YEARS
53 self._secret = None53 self._secret = None
54 # Forbid browsers from exposing it to JS.
55 self.httpOnly = True
5456
55 def getClientId(self, request):57 def getClientId(self, request):
56 sid = self.getRequestId(request)58 sid = self.getRequestId(request)
@@ -104,9 +106,6 @@ class LaunchpadCookieClientIdManager(CookieClientIdManager):
104 cookie = request.response.getCookie(self.namespace)106 cookie = request.response.getCookie(self.namespace)
105 uri = URI(request.getURL())107 uri = URI(request.getURL())
106108
107 # Forbid browsers from exposing it to JS.
108 cookie['HttpOnly'] = True
109
110 # Set secure flag on cookie.109 # Set secure flag on cookie.
111 if uri.scheme != 'http':110 if uri.scheme != 'http':
112 cookie['secure'] = True111 cookie['secure'] = True
diff --git a/lib/lp/translations/browser/language.py b/lib/lp/translations/browser/language.py
index cced791..ac18a36 100644
--- a/lib/lp/translations/browser/language.py
+++ b/lib/lp/translations/browser/language.py
@@ -163,6 +163,7 @@ class LanguageAddView(LaunchpadFormView):
163 schema = ILanguage163 schema = ILanguage
164 field_names = ['code', 'englishname', 'nativename', 'pluralforms',164 field_names = ['code', 'englishname', 'nativename', 'pluralforms',
165 'pluralexpression', 'visible', 'direction']165 'pluralexpression', 'visible', 'direction']
166 invariant_context = None
166 language = None167 language = None
167168
168 page_title = "Register a language"169 page_title = "Register a language"
diff --git a/setup.py b/setup.py
index 6a72cb8..30391e6 100644
--- a/setup.py
+++ b/setup.py
@@ -242,9 +242,14 @@ setup(
242 'zope.app.publication',242 'zope.app.publication',
243 'zope.app.publisher',243 'zope.app.publisher',
244 'zope.app.server',244 'zope.app.server',
245 'zope.app.wsgi',245 'zope.app.wsgi[testlayer]',
246 'zope.authentication',246 'zope.authentication',
247 'zope.browser',
248 'zope.browsermenu',
249 'zope.browserpage',
250 'zope.browserresource',
247 'zope.component[zcml]',251 'zope.component[zcml]',
252 'zope.configuration',
248 'zope.contenttype',253 'zope.contenttype',
249 'zope.datetime',254 'zope.datetime',
250 'zope.error',255 'zope.error',
@@ -270,7 +275,7 @@ setup(
270 'zope.session',275 'zope.session',
271 'zope.tal',276 'zope.tal',
272 'zope.tales',277 'zope.tales',
273 'zope.testbrowser[wsgi]',278 'zope.testbrowser',
274 'zope.testing',279 'zope.testing',
275 'zope.testrunner[subunit]',280 'zope.testrunner[subunit]',
276 'zope.traversing',281 'zope.traversing',

Subscribers

People subscribed via source and target branches

to status/vote changes: